Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 138840
Collapse All | Expand All

(-)portage-2.1.2~/pym/portage_locks.py (-2 / +6 lines)
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.
(-)portage-2.1.2~/pym/portage.py (-2 / +2 lines)
Lines 2432-2440 Link Here
2432
		else:
2432
		else:
2433
			if use_locks and can_fetch:
2433
			if use_locks and can_fetch:
2434
				if locks_in_subdir:
2434
				if locks_in_subdir:
2435
					file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+locks_in_subdir+"/"+myfile,wantnewlockfile=1)
2435
					file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+locks_in_subdir+"/"+myfile,wantnewlockfile=1,unlinkfile=0,distfile=1)
2436
				else:
2436
				else:
2437
					file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+myfile,wantnewlockfile=1)
2437
					file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+myfile,wantnewlockfile=1,unlinkfile=0,distfile=1)
2438
		try:
2438
		try:
2439
			if not listonly:
2439
			if not listonly:
2440
				if fsmirrors and not os.path.exists(myfile_path):
2440
				if fsmirrors and not os.path.exists(myfile_path):

Return to bug 138840