diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2013-02-25 10:13:34 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2013-03-13 15:20:02 +0000 |
commit | 0cc3de60d6282d22108ea59f169a0749be5e59ea (patch) | |
tree | 2bef9ed79c0b4d9e128b3095e72ccce4a525a532 /morphlib/buildcommand.py | |
parent | 84807d4d7c23f45d4f0a0f87e6c7ba7ba7470936 (diff) | |
download | morph-0cc3de60d6282d22108ea59f169a0749be5e59ea.tar.gz |
Add 'prefix' property for chunks within strata
Morph no longer supports setting the prefix using the --prefix
argument / setting. This was only used in tests and during bootstrap.
If a chunk build-depends on a chunk within a stratum which has
a custom prefix, that prefix is appended to the PATH in the build
environment.
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r-- | morphlib/buildcommand.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 2de71d8f..d602b5ea 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -230,6 +230,10 @@ class BuildCommand(object): setup_mounts = False if artifact.source.morphology['kind'] == 'chunk': build_mode = artifact.source.build_mode + extra_env = {'PREFIX': artifact.source.prefix} + + dep_prefix_set = artifact.get_dependency_prefix_set() + extra_path = [os.path.join(d, 'bin') for d in dep_prefix_set] if build_mode not in ['bootstrap', 'staging', 'test']: raise morphlib.Error( @@ -237,7 +241,8 @@ class BuildCommand(object): (artifact.name, build_mode)) use_chroot = build_mode=='staging' - staging_area = self.create_staging_area(use_chroot) + staging_area = self.create_staging_area( + use_chroot, extra_env=extra_env, extra_path=extra_path) self.install_fillers(staging_area) self.install_dependencies(staging_area, deps, artifact) else: @@ -312,13 +317,15 @@ class BuildCommand(object): copy(self.rac.get_artifact_metadata(artifact, 'meta'), self.lac.put_artifact_metadata(artifact, 'meta')) - def create_staging_area(self, use_chroot=True): + def create_staging_area(self, use_chroot=True, extra_env={}, + extra_path=[]): '''Create the staging area for building a single artifact.''' self.app.status(msg='Creating staging area') staging_dir = tempfile.mkdtemp(dir=self.app.settings['tempdir']) staging_area = morphlib.stagingarea.StagingArea( - self.app, staging_dir, self.build_env, use_chroot, {}) + self.app, staging_dir, self.build_env, use_chroot, extra_env, + extra_path) return staging_area def remove_staging_area(self, staging_area): |