X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=spec2make.py;fp=spec2make.py;h=94dedd8b886f764f7e0e6f1f72fb7f768b5fbfa0;hb=0a907f3452272a210fff811ef2d57f442ba43d34;hp=0e5a47df624cda27f81074ac2675fdb096b66f45;hpb=c49cee881f6bf91ee84b7205d64153306bc628b3;p=build.git diff --git a/spec2make.py b/spec2make.py index 0e5a47df..94dedd8b 100755 --- a/spec2make.py +++ b/spec2make.py @@ -50,7 +50,9 @@ def main (): target = options.target whitelist=options.whitelist.split(',') # Print non-empty packages + counter=0 for package in specobj.packages: + counter += 1 header=package.header name=header.format('%{name}') version=header.format('%{version}') @@ -60,9 +62,18 @@ def main (): # skip dummy entries if not (name and version and release and arch) : continue - whitelisted = name in whitelist + # select relevant packages + # could not find the magic recipe to do this properly yet + # so ugly temporary hack : + # when whitelisted, we expose the first package plus the white-listed ones + # otherwise we expose everything + relevant=False + if not whitelist: relevant=True + else: + if counter==1: relevant=True + else: relevant=name in whitelist - if header.fullFilelist or whitelisted: + if relevant: # attach (add) rpm path to package print "%s.rpms += RPMS/%s/%s-%s-%s.%s.rpm"%\ (package_name, arch, name, version, release, arch)