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 1QPOtm-0005a3-1s for garchives@archives.gentoo.org; Thu, 26 May 2011 00:58:02 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AA93B1C001; Thu, 26 May 2011 00:57:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6652D1C001 for ; Thu, 26 May 2011 00:57:54 +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 E442C1B400D for ; Thu, 26 May 2011 00:57:53 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 4623F80505 for ; Thu, 26 May 2011 00:57:53 +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/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dbapi/vartree.py X-VCS-Directories: pym/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: d9468f78c67e35f817389d9a36a570506720c343 Date: Thu, 26 May 2011 00:57:53 +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: c6069fbd1f9449f2ad85ee229a569d8e commit: d9468f78c67e35f817389d9a36a570506720c343 Author: Zac Medico gentoo org> AuthorDate: Thu May 26 00:57:05 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu May 26 00:57:05 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dd9468f78 unmerge: fix logging for unsupported EAPI --- pym/portage/dbapi/vartree.py | 55 ++++++++++++++++++++++--------------= ----- 1 files changed, 29 insertions(+), 26 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 021191f..62a2332 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1670,19 +1670,13 @@ class dblink(object): # We avoid a redundant setcpv call here when # the caller has already taken care of it. self.settings.setcpv(self.mycpv, mydb=3Dself.vartree.dbapi) - if myebuildpath: - try: - doebuild_environment(myebuildpath, "prerm", - settings=3Dself.settings, db=3Dself.vartree.dbapi) - except UnsupportedAPIException as e: - failures +=3D 1 - # Sometimes this happens due to corruption of the EAPI file. - showMessage(_("!!! FAILED prerm: %s\n") % \ - os.path.join(self.dbdir, "EAPI"), - level=3Dlogging.ERROR, noiselevel=3D-1) - showMessage(_unicode_decode("%s\n") % (e,), - level=3Dlogging.ERROR, noiselevel=3D-1) - myebuildpath =3D None + + eapi_unsupported =3D False + try: + doebuild_environment(myebuildpath, "prerm", + settings=3Dself.settings, db=3Dself.vartree.dbapi) + except UnsupportedAPIException as e: + eapi_unsupported =3D e =20 self._prune_plib_registry(unmerge=3DTrue, needed=3Dneeded, preserve_paths=3Dpreserve_paths) @@ -1692,18 +1686,27 @@ class dblink(object): scheduler =3D self._scheduler retval =3D os.EX_OK try: - if myebuildpath: - # Only create builddir_lock if the caller - # has not already acquired the lock. - if not builddir_locked: - builddir_lock =3D EbuildBuildDir( - scheduler=3Dscheduler, - settings=3Dself.settings) - builddir_lock.lock() - builddir_locked =3D True - prepare_build_dirs(settings=3Dself.settings, cleanup=3DTrue) - log_path =3D self.settings.get("PORTAGE_LOG_FILE") + # Only create builddir_lock if the caller + # has not already acquired the lock. + if not builddir_locked: + builddir_lock =3D EbuildBuildDir( + scheduler=3Dscheduler, + settings=3Dself.settings) + builddir_lock.lock() + prepare_build_dirs(settings=3Dself.settings, cleanup=3DTrue) + log_path =3D self.settings.get("PORTAGE_LOG_FILE") =20 + # Log the error after PORTAGE_LOG_FILE is initialized + # by prepare_build_dirs above. + if eapi_unsupported: + # Sometimes this happens due to corruption of the EAPI file. + failures +=3D 1 + showMessage(_("!!! FAILED prerm: %s\n") % \ + os.path.join(self.dbdir, "EAPI"), + level=3Dlogging.ERROR, noiselevel=3D-1) + showMessage(_unicode_decode("%s\n") % (eapi_unsupported,), + level=3Dlogging.ERROR, noiselevel=3D-1) + elif myebuildpath: phase =3D EbuildPhase(background=3Dbackground, phase=3Debuild_phase, scheduler=3Dscheduler, settings=3Dself.settings) @@ -1723,7 +1726,7 @@ class dblink(object): self.vartree.dbapi._fs_unlock() self._clear_contents_cache() =20 - if myebuildpath: + if myebuildpath and not eapi_unsupported: ebuild_phase =3D "postrm" phase =3D EbuildPhase(background=3Dbackground, phase=3Debuild_phase, scheduler=3Dscheduler, @@ -1741,7 +1744,7 @@ class dblink(object): self.vartree.dbapi._bump_mtime(self.mycpv) if builddir_locked: try: - if myebuildpath: + if myebuildpath and not eapi_unsupported: if retval !=3D os.EX_OK: msg_lines =3D [] msg =3D _("The '%(ebuild_phase)s' "