public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r9516 - in main/branches/2.1.2: bin pym
@ 2008-03-27  4:35 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-03-27  4:35 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-03-27 04:35:36 +0000 (Thu, 27 Mar 2008)
New Revision: 9516

Modified:
   main/branches/2.1.2/bin/emerge
   main/branches/2.1.2/pym/portage_locks.py
Log:
revert previous commit since it had portage_locks stuff mixed in


Modified: main/branches/2.1.2/bin/emerge
===================================================================
--- main/branches/2.1.2/bin/emerge	2008-03-27 04:33:23 UTC (rev 9515)
+++ main/branches/2.1.2/bin/emerge	2008-03-27 04:35:36 UTC (rev 9516)
@@ -1635,7 +1635,6 @@
 					return 0
 				del e
 
-		noreplace = "--noreplace" in self.myopts
 		reinstall_for_flags = None
 		merging=1
 		if mytype == "installed":
@@ -1649,7 +1648,7 @@
 			""" If we aren't merging, perform the --newuse check.
 			    If the package has new iuse flags or different use flags then if
 			    --newuse is specified, we need to merge the package. """
-			if not noreplace and merging == 0 and \
+			if merging == 0 and \
 				myroot == self.target_root and \
 				("--newuse" in self.myopts or
 				"--reinstall" in self.myopts) and \

Modified: main/branches/2.1.2/pym/portage_locks.py
===================================================================
--- main/branches/2.1.2/pym/portage_locks.py	2008-03-27 04:33:23 UTC (rev 9515)
+++ main/branches/2.1.2/pym/portage_locks.py	2008-03-27 04:35:36 UTC (rev 9516)
@@ -79,7 +79,7 @@
 	except IOError, e:
 		if "errno" not in dir(e):
 			raise
-		if e.errno in (errno.EACCES, errno.EAGAIN):
+		if e.errno == errno.EAGAIN:
 			# resource temp unavailable; eg, someone beat us to the lock.
 			if waiting_msg is None:
 				if isinstance(mypath, int):
@@ -111,7 +111,7 @@
 
 		
 	if type(lockfilename) == types.StringType and \
-		myfd != HARDLINK_FD and _fstat_nlink(myfd) == 0:
+		myfd != HARDLINK_FD and os.fstat(myfd).st_nlink == 0:
 		# The file was deleted on us... Keep trying to make one...
 		os.close(myfd)
 		portage_util.writemsg("lockfile recurse\n",1)
@@ -122,22 +122,6 @@
 	portage_util.writemsg(str((lockfilename,myfd,unlinkfile))+"\n",1)
 	return (lockfilename,myfd,unlinkfile,locking_method)
 
-def _fstat_nlink(fd):
-	"""
-	@param fd: an open file descriptor
-	@type fd: Integer
-	@rtype: Integer
-	@return: the current number of hardlinks to the file
-	"""
-	try:
-		return os.fstat(fd).st_nlink
-	except EnvironmentError, e:
-		if e.errno == errno.ENOENT:
-			# Some filesystems such as CIFS return
-			# ENOENT which means st_nlink == 0.
-			return 0
-		raise
-
 def unlockfile(mytuple):
 	import fcntl
 
@@ -183,7 +167,7 @@
 			# We won the lock, so there isn't competition for it.
 			# We can safely delete the file.
 			portage_util.writemsg("Got the lockfile...\n",1)
-			if _fstat_nlink(myfd) == 1:
+			if os.fstat(myfd).st_nlink == 1:
 				os.unlink(lockfilename)
 				portage_util.writemsg("Unlinked lockfile...\n",1)
 				locking_method(myfd,fcntl.LOCK_UN)

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-27  4:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-27  4:35 [gentoo-commits] portage r9516 - in main/branches/2.1.2: bin pym Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox