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 A0CF213800E for ; Mon, 30 Jul 2012 08:53:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A32DBE06C5; Mon, 30 Jul 2012 08:52:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 78413E06C5 for ; Mon, 30 Jul 2012 08:52:47 +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 C38D21B401D for ; Mon, 30 Jul 2012 08:52:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 0E11BE5441 for ; Mon, 30 Jul 2012 08:52:44 +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: <1343149014.6593a3562703348b5008847d92e820a75efaf921.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/packageinfo.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 6593a3562703348b5008847d92e820a75efaf921 X-VCS-Branch: master Date: Mon, 30 Jul 2012 08:52:44 +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: 48a8c9d2-4741-45ba-88d7-84096e85fee5 X-Archives-Hash: bab459fd4cfb556d3da19bb15f6355e2 Message-ID: <20120730085244.91fCLcgrflM6p9aYWHHOSmMmV4KG3E7JVfiQMf341bg@z> commit: 6593a3562703348b5008847d92e820a75efaf921 Author: André Erdmann mailerd de> AuthorDate: Tue Jul 24 16:56:54 2012 +0000 Commit: André Erdmann mailerd de> CommitDate: Tue Jul 24 16:56:54 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=6593a356 PackageInfo: _remove_auto:ebuild_written, fix get geändert: roverlay/packageinfo.py --- roverlay/packageinfo.py | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-) diff --git a/roverlay/packageinfo.py b/roverlay/packageinfo.py index 829b798..07b2e77 100644 --- a/roverlay/packageinfo.py +++ b/roverlay/packageinfo.py @@ -183,8 +183,9 @@ class PackageInfo ( object ): # this doesn't work if the package is in a sub directory # of the repo's distdir return self._info ['origin'].distdir - else: + elif 'package_file' in self._info: return os.path.dirname ( self._info ['package_file'] ) + # else fallback/KeyError elif key_low == 'has_suggests': # 'has_suggests' not in self._info -> assume False @@ -234,6 +235,12 @@ class PackageInfo ( object ): # --- end of __setitem__ (...) --- def update_now ( self, **info ): + """Updates the package info data with temporarily enabling write access. + Data will be readonly after calling this method. + + arguments: + * **info -- + """ if len ( info ) == 0: return with self._update_lock: self.set_writeable() @@ -374,7 +381,27 @@ class PackageInfo ( object ): after entering status 'ebuild_status' (like ebuild in overlay and written -> don't need the ebuild string etc.) """ - print ( "PackageInfo._remove_auto: method stub, request ignored." ) + with self._update_lock: + + if ebuild_status == 'ebuild_written': + # selectively copying required keys to a new info dict + + to_keep = ( 'distdir', 'desc_data', 'ebuild_file', 'version' ) + + # needs python >= 2.7 + info_new = { k : self.get ( k ) for k in to_keep } + + # also add an ebuild stub to the new dict (workaround, FIXME) + info_new ['ebuild'] = True + + if 'physical_only' in self._info: + info_new ['physical_only'] = self._info ['physical_only'] + + info_old = self._info + self._info = info_new + del info_old + # -- if + # -- lock # --- end of _remove_auto (...) --- def _use_filepath ( self, _filepath ):