X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_accepted.py;h=e55ac54d0a320cd53e4cc92e932103392aecdacd;hb=010895777842727186f4e1f8e9c50f9fe19281d2;hp=e53a969f48c1f35a88d292c3cb94d3ce86b3d855;hpb=9b518daca5ef156c01c203843f3a4fbd2a630434;p=dak.git diff --git a/dak/process_accepted.py b/dak/process_accepted.py index e53a969f..e55ac54d 100755 --- a/dak/process_accepted.py +++ b/dak/process_accepted.py @@ -29,8 +29,13 @@ ############################################################################### -import errno, fcntl, os, sys, time, re -import apt_pkg +import errno +import fcntl +import os +import sys +import time +import re +import apt_pkg, commands from daklib import database from daklib import logging from daklib import queue @@ -97,8 +102,10 @@ class Urgency_Log: else: os.unlink(self.log_filename) + ############################################################################### + def reject (str, prefix="Rejected: "): global reject_message if str: @@ -163,7 +170,7 @@ def init(): ('n',"no-action","Dinstall::Options::No-Action"), ('p',"no-lock", "Dinstall::Options::No-Lock"), ('s',"no-mail", "Dinstall::Options::No-Mail"), - ('d',"directory", "Dinstall::Options::Directory")] + ('d',"directory", "Dinstall::Options::Directory", "HasArg")] for i in ["automatic", "help", "no-action", "no-lock", "no-mail", "version", "directory"]: @@ -383,6 +390,12 @@ def install (): suite_id = database.get_suite_id(suite) projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%d, currval('binaries_id_seq'))" % (suite_id)) + if not database.copy_temporary_contents(package, version, architecture, newfile, reject): + print "REJECT\n" + reject_message, + projectB.query("ROLLBACK") + raise MissingContents, "No contents stored for package %s, and couldn't determine contents of %s" % (package, newfile ) + + orig_tar_id = Upload.pkg.orig_tar_id orig_tar_location = Upload.pkg.orig_tar_location @@ -426,7 +439,6 @@ def install (): utils.copy(pkg.changes_file, Cnf["Dir::Root"] + dest) for dest in copy_dot_dak.keys(): utils.copy(Upload.pkg.changes_file[:-8]+".dak", dest) - projectB.query("COMMIT WORK") # Move the .changes into the 'done' directory