summaryrefslogtreecommitdiff
path: root/morphlib/buildcommand.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-03-24 16:36:34 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-03-25 12:27:57 +0000
commit15178c227a41b4b07a1bd4fa3938dd5e31669b38 (patch)
treea5630df5cbe5b3808e2ff13de0f934ca6cfe1af7 /morphlib/buildcommand.py
parenta21def96f77772549777b0bca76ba561baebbe78 (diff)
downloadmorph-15178c227a41b4b07a1bd4fa3938dd5e31669b38.tar.gz
SUGGESTED: remove the chunk hardlink cache
The OStree checkout uses hardlinks anyway, so this is thankfully now redundant. Change-Id: Id763b76e49b5900487ee2539e5cde3c3e8d4a958
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r--morphlib/buildcommand.py21
1 files changed, 2 insertions, 19 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index c83abca6..c568fdf1 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -487,32 +487,15 @@ class BuildCommand(object):
if artifact.source.build_mode == 'bootstrap':
if not self.in_same_stratum(artifact.source, target_source):
continue
+
self.app.status(
msg='Installing chunk %(chunk_name)s from cache %(cache)s',
chunk_name=artifact.name,
cache=artifact.source.cache_key[:7],
chatty=True)
- chunk_cache_dir = os.path.join(self.app.settings['tempdir'],
- 'chunks')
artifact_checkout = os.path.join(
chunk_cache_dir, os.path.basename(artifact.basename()) + '.d')
- if not os.path.exists(artifact_checkout):
- self.app.status(
- msg='Checking out %(chunk)s from cache.',
- chunk=artifact.name
- )
- temp_checkout = os.path.join(self.app.settings['tempdir'],
- artifact.basename())
- try:
- self.lac.get(artifact, temp_checkout)
- except BaseException:
- shutil.rmtree(temp_checkout)
- raise
- # TODO: This rename is not concurrency safe if two builds are
- # extracting the same chunk, one build will fail because
- # the other renamed its tempdir here first.
- os.rename(temp_checkout, artifact_checkout)
- staging_area.install_artifact(artifact, artifact_checkout)
+ staging_area.install_artifact(self.lac, artifact)
if target_source.build_mode == 'staging':
morphlib.builder.ldconfig(self.app.runcmd, staging_area.dirname)