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 1RY09q-0007cw-RS for garchives@archives.gentoo.org; Tue, 06 Dec 2011 18:54:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB7C621C066; Tue, 6 Dec 2011 18:54:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B54B821C066 for ; Tue, 6 Dec 2011 18:54:02 +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 D69DE1B4004 for ; Tue, 6 Dec 2011 18:53:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0D6B480042 for ; Tue, 6 Dec 2011 18:53:59 +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: <96a8b44c8a1fddfa82424ad3c86b6a380ad863a2.zmedico@gentoo> 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: 96a8b44c8a1fddfa82424ad3c86b6a380ad863a2 Date: Tue, 6 Dec 2011 18:53:59 +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: ead7b0b8-da18-4b2b-be8a-21f31e1b0083 X-Archives-Hash: 4f89b8b638331b4f5129712fe234cd26 commit: 96a8b44c8a1fddfa82424ad3c86b6a380ad863a2 Author: Zac Medico gentoo org> AuthorDate: Tue Dec 6 18:52:50 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Dec 6 18:52:50 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D96a8b44c action_sync: fix git_sync_timestamps KeyError This fixes the case where $PORTDIR doesn't exist prior to sync. --- pym/_emerge/actions.py | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index a62b305..87610a6 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1971,6 +1971,7 @@ def action_sync(settings, trees, mtimedb, myopts, m= yaction): os.umask(0o022) dosyncuri =3D syncuri updatecache_flg =3D False + git =3D False if myaction =3D=3D "metadata": print("skipping sync") updatecache_flg =3D True @@ -1999,9 +2000,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(portdb, myportdir) - if exitcode =3D=3D os.EX_OK: - updatecache_flg =3D True + git =3D True elif syncuri[:8]=3D=3D"rsync://" or syncuri[:6]=3D=3D"ssh://": for vcs_dir in vcs_dirs: writemsg_level(("!!! %s appears to be under revision " + \ @@ -2443,17 +2442,25 @@ def action_sync(settings, trees, mtimedb, myopts,= myaction): noiselevel=3D-1, level=3Dlogging.ERROR) return 1 =20 - if updatecache_flg and \ - myaction !=3D "metadata" and \ - "metadata-transfer" not in settings.features: - updatecache_flg =3D False - # Reload the whole config from scratch. settings, trees, mtimedb =3D load_emerge_config(trees=3Dtrees) adjust_configs(myopts, trees) root_config =3D trees[settings['EROOT']]['root_config'] portdb =3D trees[settings['EROOT']]['porttree'].dbapi =20 + if git: + # NOTE: Do this after reloading the config, in case + # it did not exist prior to sync, so that the config + # and portdb properly account for its existence. + exitcode =3D git_sync_timestamps(portdb, myportdir) + if exitcode =3D=3D os.EX_OK: + updatecache_flg =3D True + + if updatecache_flg and \ + myaction !=3D "metadata" and \ + "metadata-transfer" not in settings.features: + updatecache_flg =3D False + if updatecache_flg and \ os.path.exists(os.path.join(myportdir, 'metadata', 'cache')): =20