summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-18 13:21:31 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-18 18:29:25 +0100
commit372c81c67be62ab00307c01cbe4bd78b28a3e9f2 (patch)
tree8724e7ecb7f8be19ed32221e562014a9630d2e5a /morph
parent0050c28846e9b40332b073c1a41dbb594fb3d26b (diff)
downloadmorph-372c81c67be62ab00307c01cbe4bd78b28a3e9f2.tar.gz
Give StagingArea a temporary directory separately
Diffstat (limited to 'morph')
-rwxr-xr-xmorph11
1 files changed, 9 insertions, 2 deletions
diff --git a/morph b/morph
index e2514042..9da4c1ab 100755
--- a/morph
+++ b/morph
@@ -21,6 +21,7 @@ import collections
import json
import logging
import os
+import shutil
import tempfile
import morphlib
@@ -280,11 +281,15 @@ class Morph(cliapp.Application):
repo = lrc.cache_repo(repo_name)
repo.update()
- if self.settings['bootstrap']:
+ if (self.settings['bootstrap'] or
+ not self.settings['staging-chroot']):
staging_root = '/'
+ staging_temp = tempfile.mkdtemp()
else:
staging_root = tempfile.mkdtemp()
- staging_area = morphlib.stagingarea.StagingArea(staging_root)
+ staging_temp = staging_root
+ staging_area = morphlib.stagingarea.StagingArea(staging_root,
+ staging_temp)
builder = morphlib.builder2.Builder(staging_area, lac,
build_env,
@@ -303,6 +308,8 @@ class Morph(cliapp.Application):
if staging_root != '/':
staging_area.remove()
+ if staging_temp != '/':
+ shutil.rmtree(staging_temp)
def cmd_show_dependencies(self, args):
'''Dumps the dependency tree of all input morphologies.'''