diff options
author | Filipp Lepalaan <filipp@mac.com> | 2016-10-19 10:09:52 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2016-10-19 10:09:52 +0300 |
commit | 2d364be7d8101ac615bf9f9cc13feccce1a9ae5c (patch) | |
tree | 45bea7e4e4ec7c0f30fa9108bd5e26bd5096402e | |
parent | afef02fcb6f5a9ee01f84e54385e37884ac67dfa (diff) | |
download | maucl-2d364be7d8101ac615bf9f9cc13feccce1a9ae5c.tar.gz maucl-2d364be7d8101ac615bf9f9cc13feccce1a9ae5c.tar.bz2 maucl-2d364be7d8101ac615bf9f9cc13feccce1a9ae5c.zip |
Throw exception in install failure
-rwxr-xr-x | mowgli.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -128,7 +128,10 @@ def download(url): def install(pkg): - subprocess.call(['/usr/sbin/installer', '-pkg', pkg, '-target', '/']) + r = subprocess.call(['/usr/sbin/installer', '-pkg', pkg, '-target', '/']) + if r > 0: + raise Exception('Failed to install package %s' % pkg) + os.remove(pkg) |