From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Q3AXx-0003lk-2k for garchives@archives.gentoo.org; Fri, 25 Mar 2011 17:11:38 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 067E01C062; Fri, 25 Mar 2011 17:11:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CDBC11C062 for ; Fri, 25 Mar 2011 17:11:29 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 415A41B40E3 for ; Fri, 25 Mar 2011 17:11:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 8E6548006A for ; Fri, 25 Mar 2011 17:11:28 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <83e1a973f7abc19c099a8459209ca0979246896b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/env_update.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 83e1a973f7abc19c099a8459209ca0979246896b Date: Fri, 25 Mar 2011 17:11:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 51f2e466cfc8d979d22d41c634e4c93f commit: 83e1a973f7abc19c099a8459209ca0979246896b Author: David James google com> AuthorDate: Fri Mar 25 17:10:54 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Mar 25 17:10:54 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D83e1a973 env_update: remove sleep_for_mtime_granularity Instead of sleeping, use os.utime to avoid mtime ambiguity. Change-Id: I359ececca19b6be9f5997ac5c8fe6fea6ea49dd5 Review URL: http://codereview.chromium.org/6676150 --- pym/portage/util/env_update.py | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pym/portage/util/env_update.py b/pym/portage/util/env_update= .py index 68531da..e2cb97f 100644 --- a/pym/portage/util/env_update.py +++ b/pym/portage/util/env_update.py @@ -181,11 +181,6 @@ def env_update(makelinks=3D1, target_root=3DNone, pr= ev_mtimes=3DNone, contents=3DNone, newprelink.write("-b %s\n" % (x,)) newprelink.close() =20 - # Portage stores mtimes with 1 second granularity but in >=3Dpython-2.5= finer - # granularity is possible. In order to avoid the potential ambiguity o= f - # mtimes that differ by less than 1 second, sleep here if any of the - # directories have been modified during the current second. - sleep_for_mtime_granularity =3D False current_time =3D long(time.time()) mtime_changed =3D False lib_dirs =3D set() @@ -205,8 +200,13 @@ def env_update(makelinks=3D1, target_root=3DNone, pr= ev_mtimes=3DNone, contents=3DNone, continue raise if newldpathtime =3D=3D current_time: - sleep_for_mtime_granularity =3D True - if x in prev_mtimes: + # Reset mtime to avoid the potential ambiguity of times that + # differ by less than 1 second. + newldpathtime -=3D 1 + os.utime(x, (newldpathtime, newldpathtime)) + prev_mtimes[x] =3D newldpathtime + mtime_changed =3D True + elif x in prev_mtimes: if prev_mtimes[x] =3D=3D newldpathtime: pass else: @@ -287,7 +287,3 @@ def env_update(makelinks=3D1, target_root=3DNone, pre= v_mtimes=3DNone, contents=3DNone, for x in env_keys: outfile.write("setenv %s '%s'\n" % (x, env[x])) outfile.close() - - if sleep_for_mtime_granularity: - while current_time =3D=3D long(time.time()): - time.sleep(1)