From: James Troup Date: Mon, 19 Apr 2004 16:04:34 +0000 (+0000) Subject: 2004-04-19 James Troup * jennifer (check_source): handle failure... X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=bab726e1e540bb0c88b3ba28c53f5b70b675fa4d;p=dak.git 2004-04-19 James Troup * jennifer (check_source): handle failure to remove the temporary directory (used for source tree extraction) better, specifically: if we fail with -EACCES, chmod -R u+rwx the temporary directory and try again and if that works, REJECT the package. --- diff --git a/TODO b/TODO index 2b056303..4667d356 100644 --- a/TODO +++ b/TODO @@ -27,6 +27,16 @@ queue/approved Others ------ + o we don't handle the case where an identical orig.tar.gz is + mentioned in the .changes, but not in unchecked; but should we + care? + + o madison could do better sanity checking for -g/-G (e.g. not more + than one suite, etc.) + + o use python2.2-tarfile (once it's in stable?) to check orig.tar.gz + timestamps too. + o need to decide on whether we're tying for most errors at once.. if so (probably) then make sure code doesn't assume variables exist and either way do something about checking error code of check_dsc and diff --git a/jennifer b/jennifer index 14b5b680..b1193561 100755 --- a/jennifer +++ b/jennifer @@ -2,7 +2,7 @@ # Checks Debian packages from Incoming # Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup -# $Id: jennifer,v 1.47 2004-04-03 02:49:46 troup Exp $ +# $Id: jennifer,v 1.48 2004-04-19 16:04:34 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ re_strip_revision = re.compile(r"-([^-]+)$"); ################################################################################ # Globals -jennifer_version = "$Revision: 1.47 $"; +jennifer_version = "$Revision: 1.48 $"; Cnf = None; Options = None; @@ -794,7 +794,22 @@ def check_source(): # Move back and cleanup the temporary tree os.chdir(cwd); - shutil.rmtree(tmpdir); + try: + shutil.rmtree(tmpdir); + except OSError, e: + if errno.errorcode[e.errno] != 'EACCES': + utils.fubar("%s: couldn't remove tmp dir for source tree." % (dsc["source"])); + + reject("%s: source tree could not be cleanly removed." % (dsc["source"])); + # We probably have u-r or u-w directories so chmod everything + # and try again. + cmd = "chmod -R u+rwx %s" % (tmpdir) + result = os.system(cmd) + if result != 0: + utils.fubar("'%s' failed with result %s." % (cmd, result)); + shutil.rmtree(tmpdir); + except: + utils.fubar("%s: couldn't remove tmp dir for source tree." % (dsc["source"])); ################################################################################