mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
projects.py: Fix and re-enable reading dependencies in-memory
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
6e21928719
commit
3b77b5ae55
1 changed files with 11 additions and 4 deletions
|
|
@ -78,9 +78,10 @@ class Build(object):
|
||||||
else:
|
else:
|
||||||
dep_cache[prereq_type] = {}
|
dep_cache[prereq_type] = {}
|
||||||
|
|
||||||
if False:
|
if True:
|
||||||
r = get_modules_from_project_txt(cur, 'pkg.requires.jw',
|
r = get_modules_from_project_txt([ cur ], 'pkg.requires.jw',
|
||||||
prereq_type, scope = 2, add_self=False, names_only=True)
|
prereq_type, scope = 2, add_self=False, names_only=True)
|
||||||
|
debug('prerequisites = ' + ' '.join(r))
|
||||||
else: # legacy from build.py
|
else: # legacy from build.py
|
||||||
projects_py="/usr/bin/python2 " + my_dir + "/projects.py --prefix " + projs_root + " " + os.getenv('PROJECTS_PY_EXTRA_ARGS', "")
|
projects_py="/usr/bin/python2 " + my_dir + "/projects.py --prefix " + projs_root + " " + os.getenv('PROJECTS_PY_EXTRA_ARGS', "")
|
||||||
cmd = projects_py + " prereq " + prereq_type + " " + cur
|
cmd = projects_py + " prereq " + prereq_type + " " + cur
|
||||||
|
|
@ -191,6 +192,7 @@ class Build(object):
|
||||||
self.run_make(m, target, cur_project, num_projects)
|
self.run_make(m, target, cur_project, num_projects)
|
||||||
|
|
||||||
def run(self, args_):
|
def run(self, args_):
|
||||||
|
global do_debug
|
||||||
visited = {}
|
visited = {}
|
||||||
glob_order = []
|
glob_order = []
|
||||||
projs_root=pwd.getpwuid(os.getuid()).pw_dir + "/local/src/jw.dev/proj"
|
projs_root=pwd.getpwuid(os.getuid()).pw_dir + "/local/src/jw.dev/proj"
|
||||||
|
|
@ -208,6 +210,8 @@ class Build(object):
|
||||||
parser.add_argument('modules', nargs='+', default='', help='Modules to be built')
|
parser.add_argument('modules', nargs='+', default='', help='Modules to be built')
|
||||||
|
|
||||||
args=parser.parse_args(args_)
|
args=parser.parse_args(args_)
|
||||||
|
if args.debug:
|
||||||
|
do_debug = True
|
||||||
|
|
||||||
debug("----------------------------------------- running ", ' '.join(args_))
|
debug("----------------------------------------- running ", ' '.join(args_))
|
||||||
|
|
||||||
|
|
@ -252,7 +256,7 @@ class Build(object):
|
||||||
print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
||||||
|
|
||||||
def debug(*objs):
|
def debug(*objs):
|
||||||
if args.debug:
|
if do_debug:
|
||||||
print("DEBUG: ", *objs, file=sys.stderr)
|
print("DEBUG: ", *objs, file=sys.stderr)
|
||||||
|
|
||||||
def err(*objs):
|
def err(*objs):
|
||||||
|
|
@ -814,6 +818,7 @@ global_args = []
|
||||||
res_cache = ResultCache()
|
res_cache = ResultCache()
|
||||||
dep_cache = {}
|
dep_cache = {}
|
||||||
my_dir = os.path.dirname(os.path.realpath(__file__))
|
my_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
do_debug = False
|
||||||
|
|
||||||
skip = 0
|
skip = 0
|
||||||
for a in sys.argv[1::]:
|
for a in sys.argv[1::]:
|
||||||
|
|
@ -838,7 +843,9 @@ parser.add_argument('--topdir', '-t', nargs='?', help='Project Path')
|
||||||
parser.add_argument('--prefix', '-p', nargs='?', default = expanduser("~") +
|
parser.add_argument('--prefix', '-p', nargs='?', default = expanduser("~") +
|
||||||
'/local/src/jw.dev/proj', help='Projects Path Prefix')
|
'/local/src/jw.dev/proj', help='Projects Path Prefix')
|
||||||
parser.add_argument('arg', nargs='*', help='Command arguments')
|
parser.add_argument('arg', nargs='*', help='Command arguments')
|
||||||
args=parser.parse_args(global_args)
|
args = parser.parse_args(global_args)
|
||||||
|
|
||||||
|
do_debug = args.debug
|
||||||
|
|
||||||
debug("----------------------------------------- running ", ' '.join(sys.argv))
|
debug("----------------------------------------- running ", ' '.join(sys.argv))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue