X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_upload.py;h=bf74baa65be064e356abaa8459b39a6688c85ad9;hb=db2d829cce8f0dd8aadb6af5e6258ab4fced871d;hp=12e25a3352316be03144f6c12f9d1facfa1c98fb;hpb=101a50f618031e5fde966959a1e57cc4d5287655;p=dak.git diff --git a/dak/process_upload.py b/dak/process_upload.py index 12e25a33..bf74baa6 100755 --- a/dak/process_upload.py +++ b/dak/process_upload.py @@ -364,7 +364,7 @@ def process_it(changes_file, session): # If this is the Real Thing(tm), copy things into a private # holding directory first to avoid replacable file races. if not Options["No-Action"]: - os.chdir(cnf["Dir::Queue::Holding"]) + holding.chdir_to_holding() # Absolutize the filename to avoid the requirement of being in the # same directory as the .changes file. @@ -424,7 +424,6 @@ def main(): cnf = Config() summarystats = SummaryStats() - log_urgency = False DBConn() @@ -456,7 +455,7 @@ def main(): # Obtain lock if not in no-action mode and initialize the log if not Options["No-Action"]: - lock_fd = os.open(cnf["Dinstall::LockFile"], os.O_RDWR | os.O_CREAT) + lock_fd = os.open(os.path.join(cnf["Dir::Lock"], 'dinstall.lock'), os.O_RDWR | os.O_CREAT) try: fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError, e: @@ -464,12 +463,12 @@ def main(): utils.fubar("Couldn't obtain lock; assuming another 'dak process-upload' is already running.") else: raise - if cnf.get("Dir::UrgencyLog"): - # Initialise UrgencyLog() - log_urgency = True - UrgencyLog() - Logger = daklog.Logger(cnf, "process-upload", Options["No-Action"]) + # Initialise UrgencyLog() - it will deal with the case where we don't + # want to log urgencies + urgencylog = UrgencyLog() + + Logger = daklog.Logger("process-upload", Options["No-Action"]) # If we have a directory flag, use it to find our files if cnf["Dinstall::Options::Directory"] != "": @@ -513,8 +512,7 @@ def main(): byebye() if not Options["No-Action"]: - if log_urgency: - UrgencyLog().close() + urgencylog.close() Logger.close()