From 97cb766c0f27f5e0166904b445050edc1d71f1fd Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 1 Aug 2016 15:47:27 -0300 Subject: [PATCH] build: add waf wrapper Simple wrapper to be extended later so people don't have to type the huge "./modules/waf/waf-light" command. It has a very primitive way to try to checkout waf submodule if it isn't there. --- waf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 waf diff --git a/waf b/waf new file mode 100755 index 0000000000..7bc5368b05 --- /dev/null +++ b/waf @@ -0,0 +1,22 @@ +#!/usr/bin/python + +from __future__ import print_function +import os +import os.path as p +import sys + +d = p.dirname(p.realpath(__file__)) +try: + os.execv(os.path.join(d, 'modules/waf/waf-light'), sys.argv) +except OSError: + print('Missing waf submodule. Trying to get it') + + from subprocess import check_call, CalledProcessError + + try: + check_call(['git', 'submodule', 'update', '--init', 'modules/waf']) + except CalledProcessError: + print('Could not update submodule', file=sys.stderr) + sys.exit(1) + + print('Submodules OK, try running again')