From 45abe82b4034bea65d08ec99341b21e2d9347426 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Fri, 23 Feb 2024 10:53:25 -0700 Subject: [PATCH] try conving name for pkg --- pv2/importer/operation.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pv2/importer/operation.py b/pv2/importer/operation.py index 51554e2..1a35f73 100644 --- a/pv2/importer/operation.py +++ b/pv2/importer/operation.py @@ -352,6 +352,7 @@ class SrpmImport(Import): distprefix: str = 'el', git_user: str = 'git', org: str = 'rpms', + preconv_names: bool = False, dest_lookaside: str = '/var/www/html/sources', verify_signature: bool = False, aws_access_key_id: str = '', @@ -373,7 +374,12 @@ class SrpmImport(Import): self.__dest_lookaside = dest_lookaside pkg_name = self.__srpm_metadata['name'] - git_url = f'ssh://{git_user}@{git_url_path}/{org}/{pkg_name}.git' + + package_name = pkg_name + if preconv_names: + package_name = pkg_name.replace('+', 'plus') + + git_url = f'ssh://{git_user}@{git_url_path}/{org}/{package_name}.git' self.__git_url = git_url file_name_search_srpm_res = re.search(r'.*?\.src\.rpm$', @@ -546,6 +552,14 @@ class SrpmImport(Import): """ return self.__srpm_metadata['name'] + @property + def rpm_name_replace(self): + """ + Returns name of srpm + """ + new_name = self.__srpm_metadata['name'].replace('+', 'plus') + return new_name + @property def rpm_version(self): """ @@ -575,14 +589,6 @@ class SrpmImport(Import): return False - @property - def rpm_name_replace(self): - """ - Returns a "fixed" version of the RPM name - """ - new_name = self.__srpm_metadata['name'].replace('+', 'plus') - return new_name - @property def distprefix(self): """