-import dak.lib.database as database
-import dak.lib.logging as logging
-import dak.lib.queue as queue
-import dak.lib.utils as utils
+import daklib.database as database
+import daklib.logging as logging
+import daklib.queue as queue
+import daklib.utils as utils
('m',"manual-reject","Reject-Proposed-Updates::Options::Manual-Reject", "HasArg"),
('s',"no-mail", "Reject-Proposed-Updates::Options::No-Mail")]
for i in [ "help", "manual-reject", "no-mail" ]:
('m',"manual-reject","Reject-Proposed-Updates::Options::Manual-Reject", "HasArg"),
('s',"no-mail", "Reject-Proposed-Updates::Options::No-Mail")]
for i in [ "help", "manual-reject", "no-mail" ]:
- if not Cnf.has_key("Reject-Proposed-Updates::Options::%s" % (i)):
- Cnf["Reject-Proposed-Updates::Options::%s" % (i)] = ""
+ if not Cnf.has_key("Reject-Proposed-Updates::Options::%s" % (i)):
+ Cnf["Reject-Proposed-Updates::Options::%s" % (i)] = ""
arguments = apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
Options = Cnf.SubTree("Reject-Proposed-Updates::Options")
if Options["Help"]:
arguments = apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
Options = Cnf.SubTree("Reject-Proposed-Updates::Options")
if Options["Help"]:
Upload = queue.Upload(Cnf)
Logger = Upload.Logger = logging.Logger(Cnf, "reject-proposed-updates")
Upload = queue.Upload(Cnf)
Logger = Upload.Logger = logging.Logger(Cnf, "reject-proposed-updates")
if Cnf.has_key("Dinstall::Bcc"):
Upload.Subst["__BCC__"] = bcc + "\nBcc: %s" % (Cnf["Dinstall::Bcc"])
else:
if Cnf.has_key("Dinstall::Bcc"):
Upload.Subst["__BCC__"] = bcc + "\nBcc: %s" % (Cnf["Dinstall::Bcc"])
else:
print "Reject message:"
print utils.prefix_multi_line_string(reject_message," ", include_blank_lines=1)
prompt = "[R]eject, Edit, Abandon, Quit ?"
print "Reject message:"
print utils.prefix_multi_line_string(reject_message," ", include_blank_lines=1)
prompt = "[R]eject, Edit, Abandon, Quit ?"
# If we fail here someone is probably trying to exploit the race
# so let's just raise an exception ...
if os.path.exists(reject_filename):
# If we fail here someone is probably trying to exploit the race
# so let's just raise an exception ...
if os.path.exists(reject_filename):
reject_fd = os.open(reject_filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0644)
# Build up the rejection email
reject_fd = os.open(reject_filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0644)
# Build up the rejection email
q = projectB.query("SELECT id FROM source WHERE source = '%s' AND version = '%s'" % (package, version))
ql = q.getresult()
if not ql:
utils.fubar("reject: Couldn't find %s_%s in source table." % (package, version))
source_id = ql[0][0]
projectB.query("DELETE FROM src_associations WHERE suite = '%s' AND source = '%s'" % (suite_id, source_id))
q = projectB.query("SELECT id FROM source WHERE source = '%s' AND version = '%s'" % (package, version))
ql = q.getresult()
if not ql:
utils.fubar("reject: Couldn't find %s_%s in source table." % (package, version))
source_id = ql[0][0]
projectB.query("DELETE FROM src_associations WHERE suite = '%s' AND source = '%s'" % (suite_id, source_id))
- elif files[file]["type"] == "deb":
- package = files[file]["package"]
- version = files[file]["version"]
- architecture = files[file]["architecture"]
+ elif files[f]["type"] == "deb":
+ package = files[f]["package"]
+ version = files[f]["version"]
+ architecture = files[f]["architecture"]
q = projectB.query("SELECT b.id FROM binaries b, architecture a WHERE b.package = '%s' AND b.version = '%s' AND (a.arch_string = '%s' OR a.arch_string = 'all') AND b.architecture = a.id" % (package, version, architecture))
ql = q.getresult()
q = projectB.query("SELECT b.id FROM binaries b, architecture a WHERE b.package = '%s' AND b.version = '%s' AND (a.arch_string = '%s' OR a.arch_string = 'all') AND b.architecture = a.id" % (package, version, architecture))
ql = q.getresult()