From 32642b1efde60f6eebcc8e53f97a8d1fc844acd3 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Sun, 10 Mar 2024 21:11:25 -0700 Subject: [PATCH] importer: fix metafile not found issue --- pv2/importer/operation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pv2/importer/operation.py b/pv2/importer/operation.py index 588177a..ada2902 100644 --- a/pv2/importer/operation.py +++ b/pv2/importer/operation.py @@ -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