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:\t(.*)-devel')
16 DIR = '/home/users/builder/rpm/packages'
21 def build_requires(name):
23 with open(os.path.join(DIR, name, name + '.spec'), 'r') as f:
25 br = PATTERN.match(line)
32 def print_packages(p):
33 if packages_res[p] == 1:
35 for pp in packages[p]:
40 if __name__ == "__main__":
42 print "Usage: %s filename" % sys.argv[0]
44 with open(sys.argv[1], 'r') as f:
49 for p in packages.keys():
50 res = build_requires(p)
54 # for p in packages.keys():
55 # print p, packages[p]
57 for p in packages.keys():