# Checks Debian packages from Incoming
# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup <james@nocrew.org>
-# $Id: jennifer,v 1.47 2004-04-03 02:49:46 troup Exp $
+# $Id: jennifer,v 1.49 2004-04-20 00:08:27 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
################################################################################
# Globals
-jennifer_version = "$Revision: 1.47 $";
+jennifer_version = "$Revision: 1.49 $";
Cnf = None;
Options = None;
copy_to_holding(file);
os.chdir(cwd);
+ # Check there isn't already a .changes or .katie file of the same name in
+ # the proposed-updates "CopyChanges" or "CopyKatie" storage directories.
+ # [NB: this check must be done post-suite mapping]
+ base_filename = os.path.basename(pkg.changes_file);
+ katie_filename = base_filename[:-8]+".katie"
+ for suite in changes["distribution"].keys():
+ copychanges = "Suite::%s::CopyChanges" % (suite);
+ if Cnf.has_key(copychanges) and \
+ os.path.exists(Cnf[copychanges]+"/"+base_filename):
+ reject("%s: a file with this name already exists in %s" \
+ % (base_filename, Cnf[copychanges]));
+
+ copykatie = "Suite::%s::CopyKatie" % (suite);
+ if Cnf.has_key(copykatie) and \
+ os.path.exists(Cnf[copykatie]+"/"+katie_filename):
+ reject("%s: a file with this name already exists in %s" \
+ % (katie_filename, Cnf[copykatie]));
+
reprocess = 0;
has_binaries = 0;
has_source = 0;
# 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"]));
################################################################################