diff -ru portage-2.1.2~/pym/portage_locks.py portage-2.1.2/pym/portage_locks.py
--- portage-2.1.2~/pym/portage_locks.py	2007-01-12 09:22:42.000000000 +0100
+++ portage-2.1.2/pym/portage_locks.py	2007-02-26 20:38:34.000000000 +0100
@@ -21,7 +21,7 @@
 def unlockdir(mylock):
 	return unlockfile(mylock)
 
-def lockfile(mypath,wantnewlockfile=0,unlinkfile=0):
+def lockfile(mypath,wantnewlockfile=0,unlinkfile=0,distfile=0):
 	"""Creates all dirs upto, the given dir. Creates a lockfile
 	for the given directory as the file: directoryname+'.portage_lockfile'."""
 	import fcntl
@@ -41,7 +41,9 @@
 	elif wantnewlockfile:
 		base, tail = os.path.split(mypath)
 		lockfilename = os.path.join(base, "." + tail + ".portage_lockfile")
-		del base, tail
+		del base
+		if not distfile:
+			del tail
 		unlinkfile   = 1
 	else:
 		lockfilename = mypath
@@ -82,6 +84,8 @@
 			# resource temp unavailable; eg, someone beat us to the lock.
 			if type(mypath) == types.IntType:
 				print "waiting for lock on fd %i" % myfd
+			elif distfile:
+				print "waiting for %s download to complete" % tail
 			else:
 				print "waiting for lock on %s" % lockfilename
 			# try for the exclusive lock now.
diff -ru portage-2.1.2~/pym/portage.py portage-2.1.2/pym/portage.py
--- portage-2.1.2~/pym/portage.py	2007-02-26 20:31:22.000000000 +0100
+++ portage-2.1.2/pym/portage.py	2007-02-26 20:32:06.000000000 +0100
@@ -2432,9 +2432,9 @@
 		else:
 			if use_locks and can_fetch:
 				if locks_in_subdir:
-					file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+locks_in_subdir+"/"+myfile,wantnewlockfile=1)
+					file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+locks_in_subdir+"/"+myfile,wantnewlockfile=1,unlinkfile=0,distfile=1)
 				else:
-					file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+myfile,wantnewlockfile=1)
+					file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+myfile,wantnewlockfile=1,unlinkfile=0,distfile=1)
 		try:
 			if not listonly:
 				if fsmirrors and not os.path.exists(myfile_path):

