From 32f0c3520c161f6521353c5abfa0d0a9267b4d85 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Thu, 13 Jul 2023 09:50:45 -0700 Subject: [PATCH] non-source rpms should not be used in the importer --- pv2/importer/operation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pv2/importer/operation.py b/pv2/importer/operation.py index 3bdd62c..962a70d 100644 --- a/pv2/importer/operation.py +++ b/pv2/importer/operation.py @@ -321,6 +321,12 @@ class SrpmImport(Import): git_url = f'ssh://{git_user}@{git_url_path}/{org}/{pkg_name}.git' self.__git_url = git_url + file_name_search_srpm_res = re.search(r'.*?\.src\.rpm$', + self.__srpm_path, re.IGNORECASE) + + if not file_name_search_srpm_res: + raise err.RpmInfoError('This is not a source package') + if len(release) == 0: self.__release = self.__get_srpm_release_version