mirror of
https://github.com/peridotbuild/pv2.git
synced 2024-12-22 10:48:31 +00:00
add modularitylabel support
This commit is contained in:
parent
06b4e59d9d
commit
60e197c9e1
@ -114,7 +114,7 @@ class Import:
|
||||
else:
|
||||
shutil.move(src=source_path, dst=dest_path)
|
||||
if os.path.exists('/usr/sbin/restorecon'):
|
||||
processor.run_proc_foreground_shell('/usr/sbin/restorecon {dest_path}')
|
||||
processor.run_proc_foreground_shell(f'/usr/sbin/restorecon {dest_path}')
|
||||
|
||||
class SrpmImport(Import):
|
||||
"""
|
||||
@ -178,6 +178,13 @@ class SrpmImport(Import):
|
||||
git_repo_path = f'/var/tmp/{self.rpm_name}'
|
||||
branch = self.__branch
|
||||
repo_tags = []
|
||||
|
||||
# We need to determine if this package has a modularity label. If it
|
||||
# does, we need to augment the branch name.
|
||||
if len(self.__srpm_metadata['modularitylabel']) > 0:
|
||||
stream_version = self.__srpm_metadata['modularitylabel'].split(':')[1]
|
||||
branch = f'{self.__branch}-stream-{stream_version}'
|
||||
|
||||
# If we return None, we need to assume that this is a brand new repo,
|
||||
# so we will try to set it up accordingly. If we return refs, we'll see
|
||||
# if the branch we want to work with exists. If it does not exist,
|
||||
|
@ -184,6 +184,11 @@ def get_rpm_metadata_from_hdr(hdr) -> dict:
|
||||
if not found_epoch:
|
||||
found_epoch = ''
|
||||
|
||||
# This avoids the modularity label being None or 'None' in the dict.
|
||||
found_modularitylabel = header_data[rpm.RPMTAG_MODULARITYLABEL]
|
||||
if not found_modularitylabel:
|
||||
found_modularitylabel = ''
|
||||
|
||||
metadata = {
|
||||
'changelog_xml': changelog_result,
|
||||
'files': file_stuff['file'],
|
||||
@ -205,6 +210,7 @@ def get_rpm_metadata_from_hdr(hdr) -> dict:
|
||||
'release': generic.to_unicode(header_data[rpm.RPMTAG_RELEASE]),
|
||||
'epoch': found_epoch,
|
||||
'arch': pkg_arch,
|
||||
'modularitylabel': found_modularitylabel,
|
||||
'signature': header_data[rpm.RPMTAG_RSAHEADER],
|
||||
}
|
||||
for key, rpmkey, in (('archivesize', rpm.RPMTAG_ARCHIVESIZE),
|
||||
|
Loading…
Reference in New Issue
Block a user