X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=inline;f=dak%2Fprocess_upload.py;h=1908ecb5ed2e2310c257555be45a6cf1059d8cc5;hb=1b70efbb284c409256589036ffe6d54c832421ea;hp=4e734da46d58cfd7756c22d11f4418a9e808a437;hpb=73cf2cb7de56fe5cdd757acd92f373c46d0332e6;p=dak.git
diff --git a/dak/process_upload.py b/dak/process_upload.py
index 4e734da4..1908ecb5 100755
--- a/dak/process_upload.py
+++ b/dak/process_upload.py
@@ -188,6 +188,7 @@ Logger = None
def usage (exit_code=0):
print """Usage: dak process-upload [OPTION]... [CHANGES]...
-a, --automatic automatic run
+ -d, --directory
process uploads in
-h, --help show this help and exit.
-n, --no-action don't do anything
-p, --no-lock don't check lockfile !! for cron.daily only !!
@@ -229,7 +230,7 @@ def action(u, session):
try:
chg = session.query(DBChange).filter_by(changesname=os.path.basename(u.pkg.changes_file)).one()
- except NoResultFound, e:
+ except NoResultFound as e:
chg = None
if len(u.rejects) > 0:
@@ -364,7 +365,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.
@@ -439,8 +440,8 @@ def main():
if not cnf.has_key("Dinstall::Options::%s" % (i)):
cnf["Dinstall::Options::%s" % (i)] = ""
- changes_files = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv)
- Options = cnf.SubTree("Dinstall::Options")
+ changes_files = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv)
+ Options = cnf.subtree("Dinstall::Options")
if Options["Help"]:
usage()
@@ -455,10 +456,10 @@ 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:
+ except IOError as e:
if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EAGAIN':
utils.fubar("Couldn't obtain lock; assuming another 'dak process-upload' is already running.")
else: