aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2005-08-28 08:37:44 +0000
committerJason Stubbs <jstubbs@gentoo.org>2005-08-28 08:37:44 +0000
commitd9fc4acc572c6647a4f27b838d35d27d805d190e (patch)
tree262a8de35d8c7567312757da5f1f66efdc8cece5 /bin/clean_locks
downloadportage-d9fc4acc572c6647a4f27b838d35d27d805d190e.tar.gz
portage-d9fc4acc572c6647a4f27b838d35d27d805d190e.tar.bz2
portage-d9fc4acc572c6647a4f27b838d35d27d805d190e.zip
Migration (without history) of the current stable line to subversion.
svn path=/main/branches/2.0/; revision=1941
Diffstat (limited to 'bin/clean_locks')
-rwxr-xr-xbin/clean_locks36
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/clean_locks b/bin/clean_locks
new file mode 100755
index 000000000..aa6669c16
--- /dev/null
+++ b/bin/clean_locks
@@ -0,0 +1,36 @@
+#!/usr/bin/python -O
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-src/portage/bin/clean_locks,v 1.1 2004/09/26 10:44:31 carpaski Exp $
+
+import os,sys
+sys.path = ["/usr/lib/portage/pym"]+sys.path
+
+import portage_locks
+
+if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv:
+ print
+ print "You must specify directories with hardlink-locks to clean."
+ print "You may optionally specify --force, which will remove all"
+ print "of the locks, even if we can't establish if they are in use."
+ print "Please attempt cleaning without force first."
+ print
+ print sys.argv[0]+" /usr/portage/distfiles/.locks"
+ print sys.argv[0]+" --force /usr/portage/distfiles/.locks"
+ print
+ sys.exit(1)
+
+force = False
+if "--force" in sys.argv[1:]:
+ force=True
+
+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
+
+
+
+ \ No newline at end of file