###############################################################################
-def action (u, stable_queue=None, log_urgency=True):
+def action (u, stable_queue=None, log_urgency=True, session=None):
(summary, short_summary) = u.build_summaries()
pi = u.package_info()
session.flush()
# Deal with contents
- contents = copy_temporary_contents(bin.package, bin.version, bin.architecture.arch_string, fullpath, None, session)
+ contents = copy_temporary_contents(bin.package, bin.version, bin.architecture.arch_string, os.path.basename(filename), None, session)
if not contents:
print "REJECT\nCould not determine contents of package %s" % bin.package
session.rollback()
# Copy the .changes file across for suite which need it.
copy_changes = {}
copy_dot_dak = {}
- for suite_name in changes["distribution"].keys():
+ for suite_name in u.pkg.changes["distribution"].keys():
if cnf.has_key("Suite::%s::CopyChanges" % (suite_name)):
copy_changes[cnf["Suite::%s::CopyChanges" % (suite_name)]] = ""
# and the .dak file...
if stable_queue:
u.pkg.changes_file = old
- u.accepted_checks(overwrite_checks, True, session)
- action(u, stable_queue, log_urgency)
+ u.accepted_checks(overwrite_checks, session)
+ action(u, stable_queue, log_urgency, session)
# Restore CWD
os.chdir(u.prevdir)
(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
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()
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