aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-12-14 02:02:23 (GMT)
committerZac Medico <zmedico@gentoo.org>2011-12-14 02:02:23 (GMT)
commitc11b7c487c518f9a2aceaddbe119a70877053cf5 (patch)
tree715e42d4a63c53417a3654f8d374bec404987355
parentRepoConfigLoader: masters eclass override order (diff)
downloadportage-c11b7c487c518f9a2aceaddbe119a70877053cf5.zip
portage-c11b7c487c518f9a2aceaddbe119a70877053cf5.tar.gz
portage-c11b7c487c518f9a2aceaddbe119a70877053cf5.tar.bz2
locks.py: make hardlink lock files hidden
This is for consistency with the behavior for normal lock files, since commit ce44ea3e914098a52bc0d1d995e71661659e77ca (bug #142369).
-rw-r--r--pym/portage/locks.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pym/portage/locks.py b/pym/portage/locks.py
index 9cfb87e..41539ba 100644
--- a/pym/portage/locks.py
+++ b/pym/portage/locks.py
@@ -1,5 +1,5 @@
# portage: Lock management code
-# Copyright 2004-2010 Gentoo Foundation
+# Copyright 2004-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = ["lockdir", "unlockdir", "lockfile", "unlockfile", \
@@ -267,7 +267,9 @@ def unlockfile(mytuple):
def hardlock_name(path):
- return path+".hardlock-"+os.uname()[1]+"-"+str(os.getpid())
+ base, tail = os.path.split(path)
+ return os.path.join(base, ".%s.hardlock-%s-%s" %
+ (tail, os.uname()[1], os.getpid()))
def hardlink_is_mine(link,lock):
try:
@@ -349,7 +351,7 @@ def hardlock_cleanup(path, remove_all_locks=False):
if os.path.isfile(path+"/"+x):
parts = x.split(".hardlock-")
if len(parts) == 2:
- filename = parts[0]
+ filename = parts[0][1:]
hostpid = parts[1].split("-")
host = "-".join(hostpid[:-1])
pid = hostpid[-1]
@@ -373,7 +375,7 @@ def hardlock_cleanup(path, remove_all_locks=False):
remove_all_locks:
for y in mylist[x]:
for z in mylist[x][y]:
- filename = path+"/"+x+".hardlock-"+y+"-"+z
+ filename = path+"/."+x+".hardlock-"+y+"-"+z
if filename == mylockname:
continue
try: