From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8A1C413800E for ; Tue, 24 Jul 2012 17:00:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 787FFE073C; Tue, 24 Jul 2012 16:59:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 48EE7E073C for ; Tue, 24 Jul 2012 16:59:54 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A1AB01B452D for ; Tue, 24 Jul 2012 16:59:53 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id A0176E5448 for ; Tue, 24 Jul 2012 16:59:50 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1343149120.c456433d70dae2e58fb0297ab1b82822b2405b2d.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:overlay_wip commit in: roverlay/overlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/overlay/creator.py roverlay/overlay/package.py X-VCS-Directories: roverlay/overlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: c456433d70dae2e58fb0297ab1b82822b2405b2d X-VCS-Branch: overlay_wip Date: Tue, 24 Jul 2012 16:59:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8a82efbd-944f-4d1e-8049-812e5f4a73a2 X-Archives-Hash: 86bc8041ab0e23e4a28366eed4c2d46a Message-ID: <20120724165950.dkuhNG0B6wZ7szf0iGjagMlNQcAYweGp5pS7BEhw67U@z> commit: c456433d70dae2e58fb0297ab1b82822b2405b2d Author: André Erdmann mailerd de> AuthorDate: Tue Jul 24 16:58:40 2012 +0000 Commit: André Erdmann mailerd de> CommitDate: Tue Jul 24 16:58:40 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=c456433d add "ebuild uncreatable" event Immediately removes the PackageInfo object from the overlay structure to save some memory. geändert: roverlay/overlay/creator.py geändert: roverlay/overlay/package.py --- roverlay/overlay/creator.py | 1 + roverlay/overlay/package.py | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/roverlay/overlay/creator.py b/roverlay/overlay/creator.py index 60e9517..5b0a973 100644 --- a/roverlay/overlay/creator.py +++ b/roverlay/overlay/creator.py @@ -382,6 +382,7 @@ class OverlayCreator ( object ): if package_info.overlay_package_ref.new_ebuild(): self.overlay_added.inc() else: + package_info.overlay_package_ref.ebuild_uncreateable ( package_info ) self.create_fail.inc() # --- end of _add_to_overlay (...) --- diff --git a/roverlay/overlay/package.py b/roverlay/overlay/package.py index bedbce3..cb5cf72 100644 --- a/roverlay/overlay/package.py +++ b/roverlay/overlay/package.py @@ -145,6 +145,25 @@ class PackageDir ( object ): return False # --- end of check_empty (...) --- + def ebuild_uncreateable ( self, package_info ): + """Called when ebuild creation (finally) failed for a PackageInfo + object of this PackageDir. + + arguments: + * package_info -- + """ + try: + self._lock.acquire() + pvr = package_info ['ebuild_verstr'] + # FIXME debug print + print ( "removing {PVR} from {PN}".format ( PVR=pvr, PN=self.name ) ) + del self._packages [pvr] + except KeyError: + pass + finally: + self._lock.release() + # --- end of uncreateable_ebuild (...) --- + def empty ( self ): """Returns True if no ebuilds stored, else False. Note that "not empty" doesn't mean "has ebuilds to write" or "has @@ -255,12 +274,11 @@ class PackageDir ( object ): return self._packages.keys() # --- end of list_versions (...) --- - def new_ebuild ( self, write=False ): + def new_ebuild ( self ): """Called when a new ebuild has been created for this PackageDir.""" self._need_manifest = True self._need_metadata = True self.modified = True - # FIXME: delete PackageInfo if ebuild creation did not succeed if self.runtime_incremental: with self._lock: return self.write_ebuilds ( overwrite=False )