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 1RK2rS-0004vY-Be for garchives@archives.gentoo.org; Sat, 29 Oct 2011 06:57:46 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 43055E00AB; Sat, 29 Oct 2011 06:57:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0EFF6E00AB for ; Sat, 29 Oct 2011 06:57:38 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 890781B4020 for ; Sat, 29 Oct 2011 06:57:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 9F64080042 for ; Sat, 29 Oct 2011 06:57:37 +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: Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/actions.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: f43280c4d8d35f02c322e88c2d97e368303d5c1a Date: Sat, 29 Oct 2011 06:57:37 +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: 110853c2c2874e1c5e331fc9a971df13 commit: f43280c4d8d35f02c322e88c2d97e368303d5c1a Author: Zac Medico gentoo org> AuthorDate: Sat Oct 29 06:57:29 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Oct 29 06:57:29 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Df43280c4 git_sync_timestamps: fix breakage This has been broken since metadbmodule support was removed in commit d4ea29bf6a3ce35d49e0f54f9173e3a6e42da2d6. --- pym/_emerge/actions.py | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index d482e0b..de5275d 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2011,7 +2011,7 @@ def action_sync(settings, trees, mtimedb, myopts, m= yaction): msg =3D ">>> Git pull in %s successful" % myportdir emergelog(xterm_titles, msg) writemsg_level(msg + "\n") - exitcode =3D git_sync_timestamps(settings, myportdir) + exitcode =3D git_sync_timestamps(portdb, myportdir) if exitcode =3D=3D os.EX_OK: updatecache_flg =3D True elif syncuri[:8]=3D=3D"rsync://" or syncuri[:6]=3D=3D"ssh://": @@ -2844,27 +2844,36 @@ def getportageversion(portdir, _unused, profile, = chost, vardb): return "Portage %s (%s, %s, %s, %s)" % \ (portage.VERSION, profilever, gccver, ",".join(libcver), unameout) =20 -def git_sync_timestamps(settings, portdir): +def git_sync_timestamps(portdb, portdir): """ Since git doesn't preserve timestamps, synchronize timestamps between entries and ebuilds/eclasses. Assume the cache has the correct timestam= p for a given file as long as the file in the working tree is not modifie= d (relative to HEAD). """ - cache_dir =3D os.path.join(portdir, "metadata", "cache") - if not os.path.isdir(cache_dir): - return os.EX_OK - writemsg_level(">>> Synchronizing timestamps...\n") =20 - from portage.cache.cache_errors import CacheError + cache_db =3D portdb._pregen_auxdb.get(portdir) + try: - cache_db =3D settings.load_best_module("portdbapi.metadbmodule")( - portdir, "metadata/cache", portage.auxdbkeys[:], readonly=3DTrue) + if cache_db is None: + # portdbapi does not populate _pregen_auxdb + # when FEATURES=3Dmetadata-transfer is enabled + cache_db =3D portdb._create_pregen_cache(portdir) except CacheError as e: writemsg_level("!!! Unable to instantiate cache: %s\n" % (e,), level=3Dlogging.ERROR, noiselevel=3D-1) return 1 =20 + if cache_db is None: + return os.EX_OK + + from portage.cache.metadata import database as pms_database + if not isinstance(cache_db, pms_database): + # newer formats like md5-dict do not require mtime sync + return os.EX_OK + + writemsg_level(">>> Synchronizing timestamps...\n") + ec_dir =3D os.path.join(portdir, "eclass") try: ec_names =3D set(f[:-7] for f in os.listdir(ec_dir) \