4 This script tries to set ordering in which packages ought to be sent to builders.
5 Input: file with names of packages (without the .spec suffix). One package name per line.
6 Output: sorted packages on stdout.
8 If the script goes in a infinite loop, that means there is a cycle or other bug.
15 PATTERN = re.compile('BuildRequires:\s+(.*?)(\s|$|-devel)')
16 DIR = '/home/users/builder/rpm/packages'
21 def build_requires(name):
24 with open(os.path.join(DIR, name, name + '.spec'), 'r') as f:
26 br = PATTERN.match(line)
33 def print_packages(p):
34 global packages, packages_res
36 if not packages_res[p]:
38 for pp in packages[p]:
39 if not packages_res[pp]:
43 if __name__ == "__main__":
45 print "Usage: %s filename" % sys.argv[0]
47 with open(sys.argv[1], 'r') as f:
52 for p in packages.keys():
53 res = build_requires(p)
57 # for p in packages.keys():
58 # print p, packages[p]
60 for p in packages.keys():