Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove the "ketchup-tmp" directory even if unpacking fails (based on …

…Johann

Felix Soden patch for the linux-3 branch)

Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
  • Loading branch information...
commit 14a16a50804682dda08f8bdbe9d36bfc5fc07674 1 parent fe4f864
@psomas authored
Showing with 12 additions and 11 deletions.
  1. +12 −11 ketchup
View
23 ketchup
@@ -720,19 +720,20 @@ def untar(tarfile):
error("Please remove the ketchup-tmp directory by hand.")
sys.exit(-1)
os.mkdir("ketchup-tmp")
- os.chdir("ketchup-tmp")
-
- err = os.system("bzcat %s | tar -xf -" % tarfile)
- if err:
- error("Unpacking failed: ", err)
- sys.exit(-1)
+ try:
+ os.chdir("ketchup-tmp")
- ldir = glob.glob("linux*")[0]
- for f in os.listdir(ldir):
- os.rename(ldir + "/" + f, "../" + f)
+ err = os.system("bzcat %s | tar -xf -" % tarfile)
+ if err:
+ error("Unpacking failed: ", err)
+ sys.exit(-1)
- os.chdir(old)
- shutil.rmtree("ketchup-tmp")
+ ldir = glob.glob("linux*")[0]
+ for f in os.listdir(ldir):
+ os.rename(ldir + "/" + f, "../" + f)
+ finally:
+ os.chdir(old)
+ shutil.rmtree("ketchup-tmp")
def install_nearest(ver):
t = tree(ver)
Please sign in to comment.
Something went wrong with that request. Please try again.