]> git.decadent.org.uk Git - dak.git/commitdiff
Merge commit 'ftpmaster/master'
authorMark Hymers <mhy@debian.org>
Sun, 11 Jul 2010 21:03:13 +0000 (21:03 +0000)
committerMark Hymers <mhy@debian.org>
Sun, 11 Jul 2010 21:03:13 +0000 (21:03 +0000)
1  2 
daklib/queue.py

diff --combined daklib/queue.py
index 29c2f4f017311f97824ac3b77727c1c7c2867576,d3727216355edc92c6433a6e34794ed82f29cbbe..165b7088e2c01a4c762d856c1e0e846427f1147b
@@@ -91,7 -91,7 +91,7 @@@ def get_type(f, session)
  
  # Determine what parts in a .changes are NEW
  
- def determine_new(changes, files, warn=1):
+ def determine_new(changes, files, warn=1, session = None):
      """
      Determine what parts in a C{changes} file are NEW.
  
      """
      new = {}
  
-     session = DBConn().session()
      # Build up a list of potentially new things
      for name, f in files.items():
          # Skip byhand elements
              if new[pkg].has_key("othercomponents"):
                  print "WARNING: %s already present in %s distribution." % (pkg, new[pkg]["othercomponents"])
  
-     session.close()
      return new
  
  ################################################################################
  
- def check_valid(new):
+ def check_valid(new, session = None):
      """
      Check if section and priority for NEW packages exist in database.
      Additionally does sanity checks:
          priority_name = new[pkg]["priority"]
          file_type = new[pkg]["type"]
  
-         section = get_section(section_name)
+         section = get_section(section_name, session)
          if section is None:
              new[pkg]["section id"] = -1
          else:
              new[pkg]["section id"] = section.section_id
  
-         priority = get_priority(priority_name)
+         priority = get_priority(priority_name, session)
          if priority is None:
              new[pkg]["priority id"] = -1
          else:
@@@ -569,8 -565,8 +565,8 @@@ class Upload(object)
          architecture = control.Find("Architecture")
          upload_suite = self.pkg.changes["distribution"].keys()[0]
  
-         if      architecture not in [a.arch_string for a in get_suite_architectures(default_suite, session)] \
-             and architecture not in [a.arch_string for a in get_suite_architectures(upload_suite, session)]:
+         if      architecture not in [a.arch_string for a in get_suite_architectures(default_suite, session = session)] \
+             and architecture not in [a.arch_string for a in get_suite_architectures(upload_suite, session = session)]:
              self.rejects.append("Unknown architecture '%s'." % (architecture))
  
          # Ensure the architecture of the .deb is one of the ones
                      entry["new"] = 1
                  else:
                      dsc_file_exists = False
 -                    for myq in ["Embargoed", "Unembargoed", "ProposedUpdates", "OldProposedUpdates"]:
 +                    for myq in ["Embargoed", "Unembargoed", "ProposedUpdates", "OldProposedUpdates", "Lenny-Volatile-Proposed-Updates"]:
                          if cnf.has_key("Dir::Queue::%s" % (myq)):
                              if os.path.exists(os.path.join(cnf["Dir::Queue::" + myq], dsc_filename)):
                                  dsc_file_exists = True