Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Zac Medico (zmedico)" <zmedico@g.o>
Subject: portage r9875 - main/branches/2.1.2/pym
Date: Sun, 13 Apr 2008 22:07:19 +0000
Author: zmedico
Date: 2008-04-13 22:07:18 +0000 (Sun, 13 Apr 2008)
New Revision: 9875

Modified:
   main/branches/2.1.2/pym/portage.py
Log:
Make movefile() tolerant to EPERM errors that can be raised from utime()
calls. Instead of failing, use stat() to return the mtime if possible.
(trunk r9863:9865)


Modified: main/branches/2.1.2/pym/portage.py
===================================================================
--- main/branches/2.1.2/pym/portage.py	2008-04-13 21:49:52 UTC (rev 9874)
+++ main/branches/2.1.2/pym/portage.py	2008-04-13 22:07:18 UTC (rev 9875)
@@ -5208,11 +5208,22 @@
 			print "!!!",e
 			return None
 
-	if newmtime:
-		os.utime(dest,(newmtime,newmtime))
-	else:
-		os.utime(dest, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME]))
-		newmtime=sstat[stat.ST_MTIME]
+	try:
+		if newmtime is not None:
+			os.utime(dest, (newmtime, newmtime))
+		else:
+			os.utime(dest, (sstat.st_atime, sstat.st_mtime))
+			newmtime = long(sstat.st_mtime)
+	except OSError:
+		# The utime can fail here with EPERM even though the move succeeded.
+		# Instead of failing, use stat to return the mtime if possible.
+		try:
+			newmtime = long(os.stat(dest).st_mtime)
+		except OSError, e:
+			writemsg("!!! Failed to stat in movefile()\n", noiselevel=-1)
+			writemsg("!!! %s\n" % dest, noiselevel=-1)
+			writemsg("!!! %s\n" % str(e), noiselevel=-1)
+			return None
 
 	if bsd_chflags:
 		# Restore the flags we saved before moving

-- 
gentoo-commits@g.o mailing list


Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in x11-libs/motif-config: motif-config-0.10-r2.ebuild
Next by thread:
gentoo-x86 commit in dev-java/commons-daemon: ChangeLog commons-daemon-1.0.1-r1.ebuild
Previous by date:
gentoo-x86 commit in x11-libs/libxklavier: libxklavier-3.3.ebuild
Next by date:
gentoo-x86 commit in dev-java/commons-daemon: ChangeLog commons-daemon-1.0.1-r1.ebuild


Updated May 05, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.