EbuildPhase: bump WORKDIR timestamp after unpack
authorZac Medico <zmedico@gentoo.org>
Sun, 9 Sep 2012 00:54:10 +0000 (17:54 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 9 Sep 2012 00:54:10 +0000 (17:54 -0700)
This will fix bug #332217.

pym/_emerge/EbuildPhase.py

index fe44abcbd274be434bb9843f398985e7b14cbbf8..c4881d465490a9f63a82448628fb9b23ea4e93c7 100644 (file)
@@ -1,10 +1,11 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import gzip
 import io
 import sys
 import tempfile
+import time
 
 from _emerge.AsynchronousLock import AsynchronousLock
 from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
@@ -213,7 +214,13 @@ class EbuildPhase(CompositeTask):
                settings = self.settings
                _post_phase_userpriv_perms(settings)
 
-               if self.phase == "install":
+               if self.phase == "unpack":
+                       # Bump WORKDIR timestamp, in case tar gave it a timestamp
+                       # that will interfere with distfiles / WORKDIR timestamp
+                       # comparisons as reported in bug #332217.
+                       timestamp = time.time()
+                       os.utime(settings["WORKDIR"], (timestamp, timestamp))
+               elif self.phase == "install":
                        out = io.StringIO()
                        _post_src_install_write_metadata(settings)
                        _post_src_install_uid_fix(settings, out)