Permalink
Browse files

Check if unzip commands exists and exit with an error message display…

…ed if not
  • Loading branch information...
1 parent 6b6b836 commit 09e27102fc9f85cb26b729d2f1c6b36e434e7799 @rodo rodo committed Jan 29, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 stdeb/util.py
View
@@ -419,7 +419,11 @@ def expand_tarball(tarball_fname,cwd=None):
def expand_zip(zip_fname,cwd=None):
"expand a zip"
- args = ['/usr/bin/unzip',zip_fname]
+ unzip_path = '/usr/bin/unzip'
+ if not os.path.exists(unzip_path):
+ log.error('ERROR: {} does not exist'.format(unzip_path))
+ sys.exit(1)
+ args = [unzip_path, zip_fname]
# Does it have a top dir
res = subprocess.Popen(
[args[0], '-l', args[1]], cwd=cwd,

0 comments on commit 09e2710

Please sign in to comment.