attempt to add rhel macro

This commit is contained in:
Louis Abel 2023-08-09 20:31:11 -07:00
parent e6627c48b7
commit d0d7581e61
Signed by: label
GPG Key ID: 2A6975660E424560

View File

@ -86,7 +86,7 @@ class Import:
raise err.RpmOpenError(f'This package could not be unpacked:\n\n{rpmerr}') raise err.RpmOpenError(f'This package could not be unpacked:\n\n{rpmerr}')
@staticmethod @staticmethod
def pack_srpm(srpm_dir, spec_file, dist_tag): def pack_srpm(srpm_dir, spec_file, dist_tag, release_ver):
""" """
Packs an srpm from available sources Packs an srpm from available sources
""" """
@ -102,7 +102,9 @@ class Import:
'--define', '--define',
f"'_topdir {srpm_dir}'", f"'_topdir {srpm_dir}'",
'--define', '--define',
f"'_sourcedir {srpm_dir}'" f"'_sourcedir {srpm_dir}'",
'--define',
f"'rhel {release_ver}'"
] ]
command_to_send = ' '.join(command_to_send) command_to_send = ' '.join(command_to_send)
returned = processor.run_proc_no_output_shell(command_to_send) returned = processor.run_proc_no_output_shell(command_to_send)
@ -359,6 +361,7 @@ class SrpmImport(Import):
return None return None
# pylint: disable=too-many-locals
def pkg_import(self, skip_lookaside: bool = False): def pkg_import(self, skip_lookaside: bool = False):
""" """
Actually perform the import Actually perform the import
@ -605,6 +608,7 @@ class GitImport(Import):
source_branch = self.source_branch source_branch = self.source_branch
dest_branch = self.dest_branch dest_branch = self.dest_branch
_dist_tag = self.dist_tag _dist_tag = self.dist_tag
release_ver = self.__release
repo_tags = [] repo_tags = []
# If the upstream repo doesn't report anything, exit. # If the upstream repo doesn't report anything, exit.
@ -710,7 +714,10 @@ class GitImport(Import):
source_git_repo_spec = self.find_spec_file(source_git_repo_path) source_git_repo_spec = self.find_spec_file(source_git_repo_path)
# attempt to pack up the RPM, get metadata # attempt to pack up the RPM, get metadata
packed_srpm = self.pack_srpm(source_git_repo_path, source_git_repo_spec, _dist_tag) packed_srpm = self.pack_srpm(source_git_repo_path,
source_git_repo_spec,
_dist_tag,
release_ver)
if not packed_srpm: if not packed_srpm:
raise err.MissingValueError( raise err.MissingValueError(
'The srpm was not written, yet command completed successfully.' 'The srpm was not written, yet command completed successfully.'