X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue.py;h=8d814e86c077828c2e7187f3de2e04416cb1d47a;hb=0872b2e0b78670c91fd2bf0bda52e5761e079820;hp=3ab87246d1601f1fc5dd52912293deb155f95b38;hpb=d74b701dca669286bcb68578c584e1de0080289b;p=dak.git diff --git a/daklib/queue.py b/daklib/queue.py index 3ab87246..8d814e86 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -78,6 +78,7 @@ def get_type(f, session): elif re_source_ext.match(f["type"]): file_type = "dsc" else: + file_type = f["type"] utils.fubar("invalid type (%s) for new. Dazed, confused and sure as heck not continuing." % (file_type)) # Validate the override type @@ -91,7 +92,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. @@ -110,8 +111,6 @@ def determine_new(changes, files, warn=1): """ new = {} - session = DBConn().session() - # Build up a list of potentially new things for name, f in files.items(): # Skip byhand elements @@ -181,13 +180,11 @@ def determine_new(changes, files, warn=1): 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: @@ -204,13 +201,13 @@ def check_valid(new): 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 +566,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 @@ -674,7 +671,7 @@ class Upload(object): 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 @@ -779,7 +776,7 @@ class Upload(object): location = cnf["Dir::Pool"] l = get_location(location, entry["component"], session=session) if l is None: - self.rejects.append("[INTERNAL ERROR] couldn't determine location (Component: %)" % entry["component"]) + self.rejects.append("[INTERNAL ERROR] couldn't determine location (Component: %s)" % entry["component"]) entry["location id"] = -1 else: entry["location id"] = l.location_id