From: Joerg Jaspert Date: Thu, 16 Apr 2009 20:58:24 +0000 (+0200) Subject: Also tell who locked something X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fce70640f9f9c07ef61ad36038e95f6988de0fd0;p=dak Also tell who locked something Signed-off-by: Joerg Jaspert --- diff --git a/dak/process_new.py b/dak/process_new.py index 9dbf293d..1354d9e2 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -51,6 +51,7 @@ import stat import sys import time import contextlib +import pwd import apt_pkg, apt_inst import examine_package from daklib import database @@ -852,7 +853,8 @@ def lock_package(package): fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDONLY) except OSError, e: if e.errno == errno.EEXIST or e.errno == errno.EACCES: - raise AlreadyLockedError, e.errno + user = pwd.getpwuid(os.stat(path)[stat.ST_UID])[4].split(',')[0].replace('.', '') + raise AlreadyLockedError, user try: yield fd @@ -999,7 +1001,7 @@ def do_pkg(changes_file): if not new and not byhand: do_accept() except AlreadyLockedError, e: - print "Seems to be locked already, skipping..." + print "Seems to be locked by %s already, skipping..." % (e) ################################################################################