From cb0df67a2775bd244da46b76a2c73ecd470f5cce Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Tue, 24 Sep 2024 01:46:46 -0700 Subject: [PATCH] add custom dist support for git import --- examples/import_git.py | 2 ++ pv2/importer/operation.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/examples/import_git.py b/examples/import_git.py index 63314e3..82c8bca 100644 --- a/examples/import_git.py +++ b/examples/import_git.py @@ -14,6 +14,7 @@ parser.add_argument('--gitorg', type=str, required=False, default='rpms') parser.add_argument('--dest-branch', type=str, required=False, default='') parser.add_argument('--release', type=str, required=False, default='') parser.add_argument('--distprefix', type=str, required=False, default='el') +parser.add_argument('--distcustom', type=str, required=False, default='') parser.add_argument('--upstream-lookaside', type=str, required=True) parser.add_argument('--alternate-spec-name', type=str, required=False, default='', help='e.g. if kernel-rt, use kernel') results = parser.parse_args() @@ -28,6 +29,7 @@ classy = importutil.GitImport( dest_branch=results.dest_branch, upstream_lookaside=results.upstream_lookaside, distprefix=results.distprefix, + distcustom=results.distcustom, alternate_spec_name=results.alternate_spec_name ) diff --git a/pv2/importer/operation.py b/pv2/importer/operation.py index e70ef7d..decc9c0 100644 --- a/pv2/importer/operation.py +++ b/pv2/importer/operation.py @@ -640,6 +640,7 @@ class GitImport(Import): source_git_protocol: str = 'https', dest_branch: str = '', distprefix: str = 'el', + distcustom: str = '', source_git_user: str = 'git', dest_git_user: str = 'git', dest_org: str = 'rpms', @@ -679,6 +680,9 @@ class GitImport(Import): self.__aws_access_key = aws_access_key self.__aws_bucket = aws_bucket + if len(distcustom) > 0: + self.__dist_tag = f'.{distcustom}' + if len(dest_branch) > 0: self.__dest_branch = dest_branch