X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_accepted.py;h=e55ac54d0a320cd53e4cc92e932103392aecdacd;hb=425e44739cd77ffa01294f23e94ae7eabd5f5ec8;hp=dce0cdbe8f0c40d502cc5fe03e37bde5a7d4422b;hpb=41310a4a047af310a0130abb6274caaa1ffbdb1d;p=dak.git diff --git a/dak/process_accepted.py b/dak/process_accepted.py index dce0cdbe..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: @@ -162,9 +169,11 @@ def init(): ('h',"help","Dinstall::Options::Help"), ('n',"no-action","Dinstall::Options::No-Action"), ('p',"no-lock", "Dinstall::Options::No-Lock"), - ('s',"no-mail", "Dinstall::Options::No-Mail")] + ('s',"no-mail", "Dinstall::Options::No-Mail"), + ('d',"directory", "Dinstall::Options::Directory", "HasArg")] - for i in ["automatic", "help", "no-action", "no-lock", "no-mail", "version"]: + for i in ["automatic", "help", "no-action", "no-lock", "no-mail", + "version", "directory"]: if not Cnf.has_key("Dinstall::Options::%s" % (i)): Cnf["Dinstall::Options::%s" % (i)] = "" @@ -174,6 +183,15 @@ def init(): if Options["Help"]: usage() + # If we have a directory flag, use it to find our files + if Cnf["Dinstall::Options::Directory"] != "": + # Note that we clobber the list of files we were given in this case + # so warn if the user has done both + if len(changes_files) > 0: + utils.warn("Directory provided so ignoring files given on command line") + + changes_files = utils.get_changes_files(Cnf["Dinstall::Options::Directory"]) + Upload = queue.Upload(Cnf) projectB = Upload.projectB @@ -372,6 +390,15 @@ 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 + # If this is a sourceful diff only upload that is moving # cross-component we need to copy the .orig.tar.gz into the new # component too for the same reasons as above. @@ -412,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