Allow only creating unified ISO for specified arch
Fixes: https://pagure.io/pungi/issue/1393 JIRA: RHELCMP-807 Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
parent
ffb65e8770
commit
0196d7fd00
@ -18,11 +18,18 @@ def parse_args():
|
||||
parser.add_argument(
|
||||
"compose", metavar="<compose-path>", nargs=1, help="path to compose",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--arch",
|
||||
metavar="<arch>",
|
||||
dest="arches",
|
||||
action="append",
|
||||
help="only generate ISOs for specified arch",
|
||||
)
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
iso = UnifiedISO(args.compose[0])
|
||||
iso = UnifiedISO(args.compose[0], arches=args.arches)
|
||||
iso.create(delete_temp=True)
|
||||
|
@ -63,7 +63,7 @@ DEFAULT_CHECKSUMS = ["md5", "sha1", "sha256"]
|
||||
|
||||
|
||||
class UnifiedISO(object):
|
||||
def __init__(self, compose_path, output_path=None):
|
||||
def __init__(self, compose_path, output_path=None, arches=None):
|
||||
self.compose_path = os.path.abspath(compose_path)
|
||||
compose_subdir = os.path.join(self.compose_path, "compose")
|
||||
if os.path.exists(compose_subdir):
|
||||
@ -84,6 +84,7 @@ class UnifiedISO(object):
|
||||
self.productid = {} # {arch/stc: {variant: old_path}
|
||||
self.conf = self.read_config()
|
||||
self.images = None # productmd.images.Images instance
|
||||
self.arches = arches
|
||||
|
||||
def create(self, delete_temp=True):
|
||||
print("Creating unified ISOs for: {0}".format(self.compose_path))
|
||||
@ -161,6 +162,8 @@ class UnifiedISO(object):
|
||||
# copy files to new location; change RPM location to $variant_uid
|
||||
for variant in self.ci.get_variants(recursive=False):
|
||||
for arch in variant.arches:
|
||||
if self.arches and arch not in self.arches:
|
||||
continue
|
||||
print("Processing: {0}.{1}".format(variant.uid, arch))
|
||||
try:
|
||||
tree_dir = os.path.join(
|
||||
|
Loading…
Reference in New Issue
Block a user