aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2016-10-19 10:09:52 +0300
committerFilipp Lepalaan <filipp@mac.com>2016-10-19 10:09:52 +0300
commit2d364be7d8101ac615bf9f9cc13feccce1a9ae5c (patch)
tree45bea7e4e4ec7c0f30fa9108bd5e26bd5096402e
parentafef02fcb6f5a9ee01f84e54385e37884ac67dfa (diff)
downloadmaucl-2d364be7d8101ac615bf9f9cc13feccce1a9ae5c.tar.gz
maucl-2d364be7d8101ac615bf9f9cc13feccce1a9ae5c.tar.bz2
maucl-2d364be7d8101ac615bf9f9cc13feccce1a9ae5c.zip
Throw exception in install failure
-rwxr-xr-xmowgli.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mowgli.py b/mowgli.py
index 5cd4e91..c1b2dd3 100755
--- a/mowgli.py
+++ b/mowgli.py
@@ -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)