]> git.decadent.org.uk Git - dak.git/blobdiff - jennifer
gracefully handle non-existent .changes files
[dak.git] / jennifer
index 96077d36976bab095edb2fc254be4f4108eecbb3..a2fb8dc025dba42a19d57db081ac798065f3f061 100755 (executable)
--- a/jennifer
+++ b/jennifer
@@ -2,7 +2,7 @@
 
 # Checks Debian packages from Incoming
 # Copyright (C) 2000, 2001  James Troup <james@nocrew.org>
-# $Id: jennifer,v 1.9 2002-03-14 14:12:04 ajt Exp $
+# $Id: jennifer,v 1.13 2002-04-16 17:35:16 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
@@ -44,7 +44,7 @@ re_is_changes = re.compile (r"(.+?)_(.+?)_(.+?)\.changes$");
 ################################################################################
 
 # Globals
-jennifer_version = "$Revision: 1.9 $";
+jennifer_version = "$Revision: 1.13 $";
 
 Cnf = None;
 Options = None;
@@ -743,6 +743,18 @@ def check_dsc ():
             if epochless_dsc_version != files[file]["version"]:
                 reject("version ('%s') in .dsc does not match version ('%s') in .changes." % (epochless_dsc_version, changes_version));
 
+            # Ensure there is a .tar.gz in the .dsc file
+            has_tar = 0;
+            for f in dsc_files.keys():
+                m = utils.re_issource.match(f);
+                if not m:
+                    reject("%s mentioned in the Files field of %s not recognised as source." % (f, file));
+                type = m.group(3);
+                if type == "orig.tar.gz" or type == "tar.gz":
+                    has_tar = 1;
+            if not has_tar:
+                reject("no .tar.gz or .orig.tar.gz listed in the Files field of %s." % (file));
+
             # Ensure source is newer than existing source in target suites
             reject(Katie.check_source_against_db(file),"");
 
@@ -858,7 +870,6 @@ def check_timestamps():
                               time.ctime(ancient_date)));
             except:
                 reject("%s: timestamp check failed; caught %s" % (filename, sys.exc_type));
-                raise;
 
 ################################################################################
 ################################################################################
@@ -867,17 +878,25 @@ def check_timestamps():
 # the file is still being uploaded.
 
 def upload_too_new():
+    too_new = 0;
+    # Move back to the original directory to get accurate time stamps
+    cwd = os.getcwd();
+    os.chdir(pkg.directory);
     file_list = pkg.files.keys();
     file_list.extend(pkg.dsc_files.keys());
     file_list.append(pkg.changes_file);
     for file in file_list:
         try:
-            last_modified = time.time()-os.path.getmtime(pkg.changes_file);
+            last_modified = time.time()-os.path.getmtime(file);
             if last_modified < int(Cnf["Dinstall::SkipTime"]):
-                return 1;
+                too_new = 1;
+                break;
         except:
             pass;
-    return 0;
+    os.chdir(cwd);
+    return too_new;
+
+################################################################################
 
 def action ():
     # changes["distribution"] may not exist in corner cases