importer: fix metafile not found issue

This commit is contained in:
Louis Abel 2024-03-10 21:11:25 -07:00
parent ff35a29d08
commit 32642b1efd
Signed by: label
GPG Key ID: 2A6975660E424560
1 changed files with 5 additions and 0 deletions

View File

@ -765,6 +765,7 @@ class GitImport(Import):
# Within the confines of the source git repo, we need to find a
# "sources" file or a metadata file. One of these will determine which
# route we take.
metafile_to_use = None
if os.path.exists(metadata_file):
no_metadata_list = ['stream', 'fedora']
if any(ignore in self.upstream_lookaside for ignore in no_metadata_list):
@ -783,6 +784,10 @@ class GitImport(Import):
with open(metadata_file, 'w+') as metadata_handle:
pass
if not metafile_to_use:
print('There was no metadata file found. Skipping.')
return False
sources_dict = self.parse_metadata_file(metafile_to_use)
# We need to check if there is a SPECS directory and make a SOURCES