2 # Copyright 1999-2006 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
10 sys.path.insert(0, "/usr/lib/portage/pym")
13 if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv:
16 print "You must specify directories with hardlink-locks to clean."
17 print "You may optionally specify --force, which will remove all"
18 print "of the locks, even if we can't establish if they are in use."
19 print "Please attempt cleaning without force first."
21 print "%s %s/.locks" % (sys.argv[0], portage.settings["DISTDIR"])
22 print "%s --force %s/.locks" % (sys.argv[0], portage.settings["DISTDIR"])
27 if "--force" in sys.argv[1:]:
30 for x in sys.argv[1:]:
34 for y in portage_locks.hardlock_cleanup(x, remove_all_locks=force):
39 if e.errno in (errno.ENOENT, errno.ENOTDIR):
40 print "!!! %s is not a directory or does not exist" % x