summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Stelling <blubb@gentoo.org>2006-05-02 17:54:19 +0000
committerSimon Stelling <blubb@gentoo.org>2006-05-02 17:54:19 +0000
commit2c0dfe6771b9d0fb71afe69d7e2c20cc4662fda3 (patch)
treefa859a8230dec637abce056ff41cac43dd13a7f0
parent89018c2a45d7ec04667c54efca85f01538abfc52 (diff)
downloadportage-2c0dfe6771b9d0fb71afe69d7e2c20cc4662fda3.tar.gz
portage-2c0dfe6771b9d0fb71afe69d7e2c20cc4662fda3.tar.bz2
portage-2c0dfe6771b9d0fb71afe69d7e2c20cc4662fda3.zip
catch ENOENT and ENOTDIR in clean_locks to prevent ugly tracebacks; bug 124164
svn path=/main/trunk/; revision=3309
-rwxr-xr-xbin/clean_locks16
1 files changed, 12 insertions, 4 deletions
diff --git a/bin/clean_locks b/bin/clean_locks
index 947f72756..2a3f06d22 100755
--- a/bin/clean_locks
+++ b/bin/clean_locks
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Id: /var/cvsroot/gentoo-src/portage/bin/clean_locks,v 1.1 2004/09/26 10:44:31 carpaski Exp $
-import os,sys
+import os,sys,errno
sys.path = ["/usr/lib/portage/pym"]+sys.path
import portage_locks
@@ -28,6 +28,14 @@ if "--force" in sys.argv[1:]:
for x in sys.argv[1:]:
if x == "--force":
continue
- for y in portage_locks.hardlock_cleanup(x, remove_all_locks=force):
- print y
- print
+ try:
+ for y in portage_locks.hardlock_cleanup(x, remove_all_locks=force):
+ print y
+ print
+
+ except OSError, e:
+ if e.errno in (errno.ENOENT, errno.ENOTDIR):
+ print "!!! %s is not a directory or does not exist" % x
+ else:
+ raise
+ sys.exit(e.errno)