X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=spec2make.py;h=a2bc7bff018ca8506c5516f7910a297b42b80ec1;hb=d2f5b4c423f9b55f62eb744b8d367d37d7d635f3;hp=0e5a47df624cda27f81074ac2675fdb096b66f45;hpb=876072815c59d4edd537604552884e8e7cf37be0;p=build.git diff --git a/spec2make.py b/spec2make.py index 0e5a47df..a2bc7bff 100755 --- a/spec2make.py +++ b/spec2make.py @@ -32,7 +32,7 @@ def main (): for (fullsource,_,__) in specobj.sources: #print '###fullsource=',fullsource print "%s.tarballs += SOURCES/%s" %(package_name,os.path.basename(fullsource)) - for suffix in [".tar.gz", ".tgz", ".tar.bz2", ] : + for suffix in [".tar.gz", ".tgz", ".tar.bz2", ".tar.xz" ] : #print "# trying %s"%suffix if fullsource.endswith(suffix): sourcename=fullsource.replace(suffix,"") @@ -48,9 +48,11 @@ def main (): print "%s.srpm := SRPMS/%s-%s-%s.src.rpm"%(package_name, name, version, release) target = options.target - whitelist=options.whitelist.split(',') + whitelist=[ x for x in options.whitelist.split(',') if x] # 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)