Lines 21-27
Link Here
|
21 |
def unlockdir(mylock): |
21 |
def unlockdir(mylock): |
22 |
return unlockfile(mylock) |
22 |
return unlockfile(mylock) |
23 |
|
23 |
|
24 |
def lockfile(mypath,wantnewlockfile=0,unlinkfile=0): |
24 |
def lockfile(mypath,wantnewlockfile=0,unlinkfile=0,distfile=0): |
25 |
"""Creates all dirs upto, the given dir. Creates a lockfile |
25 |
"""Creates all dirs upto, the given dir. Creates a lockfile |
26 |
for the given directory as the file: directoryname+'.portage_lockfile'.""" |
26 |
for the given directory as the file: directoryname+'.portage_lockfile'.""" |
27 |
import fcntl |
27 |
import fcntl |
Lines 41-47
Link Here
|
41 |
elif wantnewlockfile: |
41 |
elif wantnewlockfile: |
42 |
base, tail = os.path.split(mypath) |
42 |
base, tail = os.path.split(mypath) |
43 |
lockfilename = os.path.join(base, "." + tail + ".portage_lockfile") |
43 |
lockfilename = os.path.join(base, "." + tail + ".portage_lockfile") |
44 |
del base, tail |
44 |
del base |
|
|
45 |
if not distfile: |
46 |
del tail |
45 |
unlinkfile = 1 |
47 |
unlinkfile = 1 |
46 |
else: |
48 |
else: |
47 |
lockfilename = mypath |
49 |
lockfilename = mypath |
Lines 82-87
Link Here
|
82 |
# resource temp unavailable; eg, someone beat us to the lock. |
84 |
# resource temp unavailable; eg, someone beat us to the lock. |
83 |
if type(mypath) == types.IntType: |
85 |
if type(mypath) == types.IntType: |
84 |
print "waiting for lock on fd %i" % myfd |
86 |
print "waiting for lock on fd %i" % myfd |
|
|
87 |
elif distfile: |
88 |
print "waiting for %s download to complete" % tail |
85 |
else: |
89 |
else: |
86 |
print "waiting for lock on %s" % lockfilename |
90 |
print "waiting for lock on %s" % lockfilename |
87 |
# try for the exclusive lock now. |
91 |
# try for the exclusive lock now. |