From a8d10018d470dd14739257b04ec33e98de5df89e Mon Sep 17 00:00:00 2001 From: Francisco Demartino Date: Thu, 24 Dec 2015 03:29:34 -0300 Subject: [PATCH] buildorder.py: add targeted build order Now you can run the following: `buildorder.py [ ...]` and get the buildorder just for building those packages --- buildorder.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/buildorder.py b/buildorder.py index bb248a95c..273a10d57 100755 --- a/buildorder.py +++ b/buildorder.py @@ -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() - generate_and_print_buildorder() + + if len(sys.argv) == 1: + generate_and_print_buildorder() + + for target in sys.argv[1:]: + print_after_deps_recursive(pkgs_map[target])