projects.py: Fix ignored --prefix option

--prefix was ignored because the default was set after the commandline options
were evaluated. This commit fixes that.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-06-15 10:01:33 +00:00
commit d173f91eda

View file

@ -564,9 +564,6 @@ class Projects(object):
run_make(m, target, cur_project, num_projects) run_make(m, target, cur_project, num_projects)
def run(args_): def run(args_):
visited = {}
glob_order = []
self.projs_root = pwd.getpwuid(os.getuid()).pw_dir + "/local/src/jw.dev/proj"
# -- parse command line # -- parse command line
parser = argparse.ArgumentParser(description='janware software project build tool') parser = argparse.ArgumentParser(description='janware software project build tool')
@ -882,6 +879,9 @@ class Projects(object):
if a[0] != '-': if a[0] != '-':
break break
# -- defaults
self.projs_root = pwd.getpwuid(os.getuid()).pw_dir + "/local/src/jw.dev/proj"
parser = argparse.ArgumentParser(description='Project metadata evaluation') parser = argparse.ArgumentParser(description='Project metadata evaluation')
parser.add_argument('-d', '--debug', action='store_true', parser.add_argument('-d', '--debug', action='store_true',
default=False, help='Output debug information to stderr') default=False, help='Output debug information to stderr')
@ -899,6 +899,7 @@ class Projects(object):
self.debug("----------------------------------------- running ", ' '.join(sys.argv)) self.debug("----------------------------------------- running ", ' '.join(sys.argv))
self.projs_root = args.prefix[0] self.projs_root = args.prefix[0]
self.debug("projs_root = ", self.projs_root)
if len(args.topdir): if len(args.topdir):
self.topdir = args.topdir[0] self.topdir = args.topdir[0]