]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/queue.py
Fix my very own shiny bug
[dak.git] / daklib / queue.py
index 76d19c163ebeca1bbf4bc8391538193187b58ed7..58a8783442f70a87281dc96ffabdadae6d4e05ae 100755 (executable)
@@ -6,7 +6,7 @@ Queue utility functions for dak
 
 @contact: Debian FTP Master <ftpmaster@debian.org>
 @copyright: 2001 - 2006 James Troup <james@nocrew.org>
-@copyright: 2009  Joerg Jaspert <joerg@debian.org>
+@copyright: 2009, 2010  Joerg Jaspert <joerg@debian.org>
 @license: GNU General Public License version 2 or later
 """
 
@@ -231,17 +231,6 @@ def check_valid(new):
 
 ###############################################################################
 
-def check_status(files):
-    new = byhand = 0
-    for f in files.keys():
-        if files[f].has_key("byhand"):
-            byhand = 1
-        elif files[f].has_key("new"):
-            new = 1
-    return (new, byhand)
-
-###############################################################################
-
 # Used by Upload.check_timestamps
 class TarTime(object):
     def __init__(self, future_cutoff, past_cutoff):
@@ -361,8 +350,14 @@ class Upload(object):
     ###########################################################################
     def load_changes(self, filename):
         """
+        Load a changes file and setup a dictionary around it. Also checks for mandantory
+        fields  within.
+
+        @type filename: string
+        @param filename: Changes filename, full path.
+
         @rtype: boolean
-        @rvalue: whether the changes file was valid or not.  We may want to
+        @return: whether the changes file was valid or not.  We may want to
                  reject even if this is True (see what gets put in self.rejects).
                  This is simply to prevent us even trying things later which will
                  fail because we couldn't properly parse the file.
@@ -1096,9 +1091,7 @@ class Upload(object):
     def check_source(self):
         # Bail out if:
         #    a) there's no source
-        # or c) the orig files are MIA
-        if not self.pkg.changes["architecture"].has_key("source") \
-           or len(self.pkg.orig_files) == 0:
+        if not self.pkg.changes["architecture"].has_key("source"):
             return
 
         tmpdir = utils.temp_dirname()
@@ -1232,7 +1225,7 @@ class Upload(object):
             found = False
 
             # Look in the pool
-            for poolfile in get_poolfile_like_name('/%s' % filename, session_):
+            for poolfile in get_poolfile_like_name('%s' % filename, session_):
                 poolfile_path = os.path.join(
                     poolfile.location.path, poolfile.filename
                 )
@@ -1944,14 +1937,15 @@ distribution."""
 
         ## Helper stuff for DebBugs Version Tracking
         if cnf.Find("Dir::Queue::BTSVersionTrack"):
-            (fd, temp_filename) = utils.temp_filename(cnf["Dir::Queue::BTSVersionTrack"], prefix=".")
-            version_history = os.fdopen(fd, 'w')
-            version_history.write(self.pkg.dsc["bts changelog"])
-            version_history.close()
-            filename = "%s/%s" % (cnf["Dir::Queue::BTSVersionTrack"],
-                                  self.pkg.changes_file[:-8]+".versions")
-            os.rename(temp_filename, filename)
-            os.chmod(filename, 0644)
+            if self.pkg.changes["architecture"].has_key("source"):
+                (fd, temp_filename) = utils.temp_filename(cnf["Dir::Queue::BTSVersionTrack"], prefix=".")
+                version_history = os.fdopen(fd, 'w')
+                version_history.write(self.pkg.dsc["bts changelog"])
+                version_history.close()
+                filename = "%s/%s" % (cnf["Dir::Queue::BTSVersionTrack"],
+                                      self.pkg.changes_file[:-8]+".versions")
+                os.rename(temp_filename, filename)
+                os.chmod(filename, 0644)
 
             # Write out the binary -> source mapping.
             (fd, temp_filename) = utils.temp_filename(cnf["Dir::Queue::BTSVersionTrack"], prefix=".")
@@ -2053,8 +2047,8 @@ distribution."""
         directory it will be moved to the morgue to make way for
         the new file.
 
-        @type files: dict
-        @param files: file dictionary
+        @type reject_files: dict
+        @param reject_files: file dictionary
 
         """