Ejemplo n.º 1
0
 def __execute_steps(self,
                     pi: PackageIdentifier,
                     ipmap: dict,
                     se_func: callable,
                     env: Environment = None):
     # Find the package
     ip = find_manifest(pi, ipmap)
     # The environment
     if env is None:
         env = Environment.build(self.build_builtin_environment(),
                                 self.build_user_environment())
     # build the dependencies
     deps = DependencyUtils.installed([pi],
                                      ipmap,
                                      env=env,
                                      ignore_unknown=True)
     # Update env
     env.append(self.build_packages_environment(deps))
     # Fix PREREQ_ROOT
     env.set_variable("LEAF_PREREQ_ROOT", self.install_folder)
     # The Variable resolver
     vr = VariableResolver(ip, ipmap.values())
     # Execute steps
     se = StepExecutor(self.logger, ip, vr, env=env)
     se_func(se)
Ejemplo n.º 2
0
 def build_builtin_environment(self):
     out = Environment("Leaf built-in variables")
     out.set_variable("LEAF_VERSION", str(__version__))
     out.set_variable("LEAF_PLATFORM_SYSTEM", platform.system())
     out.set_variable("LEAF_PLATFORM_MACHINE", platform.machine())
     out.set_variable("LEAF_PLATFORM_RELEASE", platform.release())
     return out