summaryrefslogtreecommitdiff
path: root/morphlib/stagingarea.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/stagingarea.py')
-rw-r--r--morphlib/stagingarea.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py
index 9aa8021b..3d756df7 100644
--- a/morphlib/stagingarea.py
+++ b/morphlib/stagingarea.py
@@ -309,3 +309,17 @@ class StagingArea(object):
(self.dirname, ' '.join(argv)))
else:
return self._app.runcmd(argv, **kwargs)
+
+ def abort(self): # pragma: no cover
+ '''Handle what to do with a staging area in the case of failure.
+ This may either remove it or save it for later inspection.
+ '''
+ # TODO: when we add the option to throw away failed builds,
+ # hook it up here
+
+
+ dest_dir = os.path.join(self._app.settings['tempdir'],
+ 'failed', os.path.basename(self.dirname))
+ os.rename(self.dirname, dest_dir)
+ self.dirname = dest_dir
+