mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 12:12:47 +00:00
Cleanup builders on interruption when called directly
This commit is contained in:
parent
8be80a288e
commit
e434f14459
1 changed files with 14 additions and 9 deletions
|
@ -127,16 +127,21 @@ class BuilderBase(object):
|
|||
# Reset list of artifacts on each call to run().
|
||||
self.artifacts = []
|
||||
|
||||
if options.tgz:
|
||||
self.tgz()
|
||||
if options.srpm:
|
||||
self.srpm()
|
||||
if options.rpm:
|
||||
# TODO: not protected anymore
|
||||
self.rpm()
|
||||
self._auto_install()
|
||||
try:
|
||||
try:
|
||||
if options.tgz:
|
||||
self.tgz()
|
||||
if options.srpm:
|
||||
self.srpm()
|
||||
if options.rpm:
|
||||
# TODO: not protected anymore
|
||||
self.rpm()
|
||||
self._auto_install()
|
||||
except KeyboardInterrupt:
|
||||
print("Interrupted, cleaning up...")
|
||||
finally:
|
||||
self.cleanup()
|
||||
|
||||
self.cleanup()
|
||||
return self.artifacts
|
||||
|
||||
def cleanup(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue