diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-18 13:21:31 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-18 18:29:25 +0100 |
commit | 372c81c67be62ab00307c01cbe4bd78b28a3e9f2 (patch) | |
tree | 8724e7ecb7f8be19ed32221e562014a9630d2e5a /morph | |
parent | 0050c28846e9b40332b073c1a41dbb594fb3d26b (diff) | |
download | morph-372c81c67be62ab00307c01cbe4bd78b28a3e9f2.tar.gz |
Give StagingArea a temporary directory separately
Diffstat (limited to 'morph')
-rwxr-xr-x | morph | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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.''' |