X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue.py;h=b11534a0592ac4b7e7f1f8316dbc8a13b7bae9a6;hb=79580b4e9a21dfbdae877af9890ba4b3f84e7c63;hp=ae4cf0bd4f4360f982c66eb7ab7e2196236b9723;hpb=f558a3d8c95f65f905d46681c1d43e6986fee256;p=dak.git diff --git a/daklib/queue.py b/daklib/queue.py index ae4cf0bd..b11534a0 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -486,7 +486,7 @@ class Upload(object): (source, dest) = args[1:3] if self.pkg.changes["distribution"].has_key(source): for arch in self.pkg.changes["architecture"].keys(): - if arch not in [ arch_string for a in get_suite_architectures(source) ]: + if arch not in [ a.arch_string for a in get_suite_architectures(source) ]: self.notes.append("Mapping %s to %s for unreleased architecture %s." % (source, dest, arch)) del self.pkg.changes["distribution"][source] self.pkg.changes["distribution"][dest] = 1 @@ -740,6 +740,16 @@ class Upload(object): if entry.has_key("byhand"): return + # Check we have fields we need to do these checks + oktogo = True + for m in ['component', 'package', 'priority', 'size', 'md5sum']: + if not entry.has_key(m): + self.rejects.append("file '%s' does not have field %s set" % (f, m)) + oktogo = False + + if not oktogo: + return + # Handle component mappings for m in cnf.ValueList("ComponentMappings"): (source, dest) = m.split() @@ -754,8 +764,7 @@ class Upload(object): return # Validate the component - component = entry["component"] - if not get_component(component, session): + if not get_component(entry["component"], session): self.rejects.append("file '%s' has unknown component '%s'." % (f, component)) return @@ -2068,6 +2077,8 @@ distribution.""" # TODO: Record the queues and info in the DB so we don't hardcode all this crap # Not there? Check the queue directories... for directory in [ "Accepted", "New", "Byhand", "ProposedUpdates", "OldProposedUpdates", "Embargoed", "Unembargoed" ]: + if not Cnf.has_key("Dir::Queue::%s" % (directory)): + continue in_otherdir = os.path.join(Cnf["Dir::Queue::%s" % (directory)], dsc_name) if os.path.exists(in_otherdir): in_otherdir_fh = utils.open_file(in_otherdir)