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 65B431381F3 for ; Thu, 29 Aug 2013 12:36:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2B2B8E0D7F; Thu, 29 Aug 2013 12:36:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7271AE0D62 for ; Thu, 29 Aug 2013 12:36:38 +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 5B66333ED17 for ; Thu, 29 Aug 2013 12:36:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 6C540E468F for ; Thu, 29 Aug 2013 12:36:34 +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: <1377779486.dc32952a22c40f03be7f25ba1be425f8faf5dfa7.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/overlay/pkgdir/distroot/distroot.py X-VCS-Directories: roverlay/overlay/pkgdir/distroot/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: dc32952a22c40f03be7f25ba1be425f8faf5dfa7 X-VCS-Branch: master Date: Thu, 29 Aug 2013 12:36:34 +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: aceb28bc-a91c-449a-a2b9-e0ec6917bdd4 X-Archives-Hash: a42cb60d9ccf08bc02f19b8fafdb05bb commit: dc32952a22c40f03be7f25ba1be425f8faf5dfa7 Author: André Erdmann mailerd de> AuthorDate: Thu Aug 29 12:31:26 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Thu Aug 29 12:31:26 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=dc32952a mirror directory: set_distfile_owner() (TODO) method stub for declaring distfile "owners" (=PackageDir objects owning a distfile). --- roverlay/overlay/pkgdir/distroot/distroot.py | 40 +++++++++++++++++++++------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py index 650ea15..86a4d76 100644 --- a/roverlay/overlay/pkgdir/distroot/distroot.py +++ b/roverlay/overlay/pkgdir/distroot/distroot.py @@ -19,6 +19,7 @@ import tempfile import roverlay.db.distmap import roverlay.overlay.pkgdir.distroot.distdir import roverlay.util.hashpool +import roverlay.util.objects class DistrootBase ( object ): @@ -91,6 +92,7 @@ class DistrootBase ( object ): self.distmap.write ( force=False ) # --- end of finalize (...) --- + @roverlay.util.objects.abstractmethod def _add ( self, src, dest ): """Adds src to the distroot. @@ -100,8 +102,7 @@ class DistrootBase ( object ): * src -- * dest -- """ - # derived classes have to implement this - raise NotImplementedError() + pass # --- end of _add (...) --- def _add_symlink ( self, src, dest, filter_exceptions=False ): @@ -355,6 +356,11 @@ class DistrootBase ( object ): raise Exception ( "check_integrity() needs a distmap." ) # --- end of check_integrity (...) --- + @roverlay.util.objects.abstractmethod + def set_distfile_owner ( self, backref, distfile ): + pass + # --- end of set_distfile_owner (...) --- + # --- end of DistrootBase --- @@ -379,6 +385,10 @@ class TemporaryDistroot ( DistrootBase ): shutil.rmtree ( self._root ) # --- end of _cleanup (...) --- + def set_distfile_owner ( self, *args, **kwargs ): + return True + # --- end of set_distfile_owner (...) --- + # --- end of TemporaryDistroot --- @@ -440,15 +450,27 @@ class PersistentDistroot ( DistrootBase ): self.USE_COPY : self._add_file, } - - if verify and self.distmap is not None: - # expensive task, print a message - print ( - "Checking distroot file integrity, this may take some time ... " - ) - self.check_integrity() + if self.distmap is not None: + self.set_distfile_owner = self._set_distfile_owner_distmap + if verify: + # expensive task, print a message + print ( + "Checking distroot file integrity, this may take some time ... " + ) + self.check_integrity() + else: + self.set_distfile_owner = self._set_distfile_owner_nop # --- end of __init__ (...) --- + def _set_distfile_owner_nop ( self, backref, distfile ): + return True + # --- end of _set_distfile_owner_nop (...) --- + + @roverlay.util.objects.not_implemented + def _set_distfile_owner_distmap ( self, backref, distfile ): + pass + # --- end of _set_distfile_owner_distmap (...) --- + def _add ( self, src, dest ): # race condition when accessing self._supported_modes # * this can result in repeated log messages