]> git.decadent.org.uk Git - dak.git/blobdiff - dak/process_unchecked.py
override
[dak.git] / dak / process_unchecked.py
index b2097def91f3982734df160c78815f6956587829..fdf052d269440190dbdf7f0281662f4646ac7bba 100755 (executable)
@@ -1,7 +1,12 @@
 #!/usr/bin/env python
 
-""" Checks Debian packages from Incoming """
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
+"""
+Checks Debian packages from Incoming
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2000, 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
+@copyright: 2009  Joerg Jaspert <joerg@debian.org>
+@license: GNU General Public License version 2 or later
+"""
 
 # 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
@@ -437,6 +442,15 @@ def check_files():
                 deb_file.close()
                 # Can't continue, none of the checks on control would work.
                 continue
+
+            # Check for mandantory "Description:"
+            deb_file.seek ( 0 )
+            try:
+                apt_pkg.ParseSection(apt_inst.debExtractControl(deb_file))["Description"] + '\n'
+            except:
+                reject("%s: Missing Description in binary package" % (f))
+                continue
+
             deb_file.close()
 
             # Check for mandatory fields
@@ -1003,10 +1017,10 @@ def lookup_uid_from_fingerprint(fpr):
     """
     Return the uid,name,isdm for a given gpg fingerprint
 
-    @ptype fpr: string
+    @type fpr: string
     @param fpr: a 40 byte GPG fingerprint
 
-    @return (uid, name, isdm)
+    @return: (uid, name, isdm)
     """
     cursor = DBConn().cursor()
     cursor.execute( "SELECT u.uid, u.name, k.debian_maintainer FROM fingerprint f JOIN keyrings k ON (f.keyring=k.id), uid u WHERE f.uid = u.id AND f.fingerprint = '%s'" % (fpr))
@@ -1483,7 +1497,7 @@ def acknowledge_new (summary, short_summary):
     Logger.log(["Moving to new", pkg.changes_file])
 
     Upload.dump_vars(Cnf["Dir::Queue::New"])
-    move_to_dir(Cnf["Dir::Queue::New"])
+    move_to_dir(Cnf["Dir::Queue::New"], perms=0640, changesperms=0644)
 
     if not Options["No-Mail"]:
         print "Sending new ack."
@@ -1576,7 +1590,10 @@ def main():
             changes_files.remove(f)
 
     if changes_files == []:
-        utils.fubar("Need at least one .changes file as an argument.")
+        if Cnf["Dinstall::Options::Directory"] == "":
+            utils.fubar("Need at least one .changes file as an argument.")
+        else:
+            sys.exit(0)
 
     # Check that we aren't going to clash with the daily cron job