Skip to content
Snippets Groups Projects
Commit 30f451c5 authored by Seblu's avatar Seblu
Browse files

Keep global dict between parser and setup

parent bf679786
No related branches found
No related tags found
No related merge requests found
......@@ -74,12 +74,17 @@ try:
exit(1)
# install start time
t0 = time.time()
# global dict of execution context
gl_exec = { "parser": p_main }
# run parser scripts
pkg.run_parser({ "parser": p_main })
pkg.run_parser(gl_exec)
# call parser again, with extended attributes
arrow("Run parser", 1, args.verbose)
args = p_main.parse_args()
# add parser result to global dict
gl_exec["args"] = args
# run setup scripts
pkg.run_setup({"args": args})
pkg.run_setup(gl_exec)
# compute building time
t1 = time.time()
dt = int(t1 - t0)
......
......@@ -379,6 +379,7 @@ class PackageImage(Image):
'''
Run parser scripts
'''
gl["image"] = self
self._run_scripts(gl, "parser")
def run_setup(self, gl):
......@@ -392,7 +393,7 @@ class PackageImage(Image):
'''
Run scripts in a tarball directory
'''
arrow("Run %s" % directory, 1, self.verbose)
arrow("Run %s scripts" % directory, 1, self.verbose)
# get list of parser scripts
l_scripts = self._tarball.getnames("%s/.*\.py" % directory)
# order matter!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment