buildorder.py: add targeted build order

Now you can run the following:

`buildorder.py <package> [<package> ...]`

and get the buildorder just for building those packages
This commit is contained in:
Francisco Demartino 2015-12-24 03:29:34 -03:00
parent da6299f059
commit a8d10018d4

View File

@ -9,10 +9,6 @@ def die(msg):
sys.exit('ERROR: ' + msg)
if len(sys.argv) != 1:
die('buildorder.py takes no arguments')
class TermuxBuildFile(object):
def __init__(self, path):
self.path = path
@ -192,6 +188,17 @@ def generate_and_print_buildorder():
sys.exit(0)
def print_after_deps_recursive(pkg):
for dep in sorted(pkg.deps):
print_after_deps_recursive(pkgs_map[dep])
print(pkg.name)
if __name__ == '__main__':
populate()
if len(sys.argv) == 1:
generate_and_print_buildorder()
for target in sys.argv[1:]:
print_after_deps_recursive(pkgs_map[target])