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 1R41qC-0006BO-TD for garchives@archives.gentoo.org; Thu, 15 Sep 2011 02:38:17 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0DD8721C057; Thu, 15 Sep 2011 02:38:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D004C21C057 for ; Thu, 15 Sep 2011 02:38:08 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 60C011B400F for ; Thu, 15 Sep 2011 02:38:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 8BE3A80042 for ; Thu, 15 Sep 2011 02:38:07 +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: <7a216218968dc1d00f2881121870611bc1b5dd33.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/manifest.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 7a216218968dc1d00f2881121870611bc1b5dd33 Date: Thu, 15 Sep 2011 02:38:07 +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: 26cbd23578988be9b37055907db1fb0f commit: 7a216218968dc1d00f2881121870611bc1b5dd33 Author: Zac Medico gentoo org> AuthorDate: Thu Sep 15 02:36:54 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Sep 15 02:36:54 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D7a216218 Remove Manifest if it is not needed. With thin manifest, there's no need to have a Manifest file if there are no DIST entries. --- pym/portage/manifest.py | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index 32cc2c0..449f9fd 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -241,7 +241,7 @@ class Manifest(object): try: myentries =3D list(self._createManifestEntries()) update_manifest =3D True - if not force: + if myentries and not force: try: f =3D io.open(_unicode_encode(self.getFullname(), encoding=3D_encodings['fs'], errors=3D'strict'), @@ -257,15 +257,23 @@ class Manifest(object): break except (IOError, OSError) as e: if e.errno =3D=3D errno.ENOENT: - if not myentries: - # With thin manifest, there's no need to have - # a Manifest file if there are no DIST entries. - update_manifest =3D False + pass else: raise + if update_manifest: - write_atomic(self.getFullname(), - "".join("%s\n" % str(myentry) for myentry in myentries)) + if myentries: + write_atomic(self.getFullname(), "".join("%s\n" % + str(myentry) for myentry in myentries)) + else: + # With thin manifest, there's no need to have + # a Manifest file if there are no DIST entries. + try: + os.unlink(self.getFullname()) + except OSError as e: + if e.errno !=3D errno.ENOENT: + raise + if sign: self.sign() except (IOError, OSError) as e: