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 657C21381F3 for ; Wed, 10 Jul 2013 16:17:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 57C64E0A82; Wed, 10 Jul 2013 16:17:10 +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 D5246E0A82 for ; Wed, 10 Jul 2013 16:17:04 +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 E7F9033E90E for ; Wed, 10 Jul 2013 16:16:57 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id AE464E5458 for ; Wed, 10 Jul 2013 16:16:54 +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: <1373465378.45b5e9f8e6aac6d6729e96b46849f7bf4e9c9f56.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/overlay/pkgdir/packagedir_base.py X-VCS-Directories: roverlay/overlay/pkgdir/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 45b5e9f8e6aac6d6729e96b46849f7bf4e9c9f56 X-VCS-Branch: master Date: Wed, 10 Jul 2013 16:16:54 +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: c77fdd3a-ee0d-47c3-a59a-f7161b055cd2 X-Archives-Hash: b92715153656751c6df0fbd0e15d381e commit: 45b5e9f8e6aac6d6729e96b46849f7bf4e9c9f56 Author: André Erdmann mailerd de> AuthorDate: Wed Jul 10 14:09:38 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Wed Jul 10 14:09:38 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=45b5e9f8 pkgdir_base: fixup * unused variables removed: HASHES, SUPPRESS_EXCEPTIONS * added DOEBUILD_FETCH to set the doebuild fetch function (class-wide) * get_distdir(), fetch_src_for_ebuild() added --- roverlay/overlay/pkgdir/packagedir_base.py | 39 +++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/roverlay/overlay/pkgdir/packagedir_base.py b/roverlay/overlay/pkgdir/packagedir_base.py index 63adfb4..53ebc42 100644 --- a/roverlay/overlay/pkgdir/packagedir_base.py +++ b/roverlay/overlay/pkgdir/packagedir_base.py @@ -1,6 +1,6 @@ # R overlay -- overlay package, package directory # -*- coding: utf-8 -*- -# Copyright (C) 2012 André Erdmann +# Copyright (C) 2012, 2013 André Erdmann # Distributed under the terms of the GNU General Public License; # either version 2 of the License, or (at your option) any later version. @@ -37,6 +37,8 @@ import roverlay.overlay.additionsdir import roverlay.overlay.pkgdir.distroot.static import roverlay.overlay.pkgdir.metadata +# TODO: proper reading of $SRC_URI when importing (or scanning) ebuilds +# This would make manifest creation being more controlled class PackageDirBase ( object ): """The PackageDir base class that implements most functionality except @@ -44,10 +46,9 @@ class PackageDirBase ( object ): #DISTROOT = #DISTMAP = - EBUILD_SUFFIX = '.ebuild' #FETCHENV = - #HASHES = - SUPPRESS_EXCEPTIONS = True + + EBUILD_SUFFIX = '.ebuild' # MANIFEST_THREADSAFE (tri-state) # * None -- unknown (e.g. write_manifest() not implemented) @@ -56,6 +57,12 @@ class PackageDirBase ( object ): # MANIFEST_THREADSAFE = None + # DOEBUILD_FETCH + # doebuild function that fetches $SRC_URI + # can be overridden by subclasses if e.g. on-the-fly manifest creation + # is required, too + DOEBUILD_FETCH = roverlay.tools.ebuild.doebuild_fetch + @classmethod def init_base_cls ( cls ): # env for calling "ebuild fetch" @@ -66,9 +73,6 @@ class PackageDirBase ( object ): cls.DISTROOT = roverlay.overlay.pkgdir.distroot.static.get_configured() cls.DISTMAP = roverlay.recipe.distmap.access() - # FIXME/TODO: config - #cls.HASHES = frozenset ({ 'sha256', 'sha512', 'whirlpool', }) - cls.HASHES = frozenset ({ 'sha256', }) cls.FETCHENV = fetch_env # --- end of init_cls (...) --- @@ -581,6 +585,18 @@ class PackageDirBase ( object ): return success # --- end of write (...) --- + def get_distdir ( self ): + return self.DISTROOT.get_distdir ( self.name ) + # --- end of get_distdir (...) --- + + def fetch_src_for_ebuild ( self, efile ): + return self.DOEBUILD_FETCH ( + ebuild_file = efile, + logger = self.logger, + env = self.FETCHENV.get_env ( self.get_distdir().get_root() ) + ) + # --- end of fetch_src_for_ebuild (...) --- + def import_ebuilds ( self, eview, overwrite, nosync=False ): """Imports ebuilds from an additions dir into this package dir. @@ -625,12 +641,7 @@ class PackageDirBase ( object ): self._need_manifest = True # fetch SRC_URI using ebuild(1) - if not nosync and not roverlay.tools.ebuild.doebuild_fetch ( - efile_dest, self.logger, - self.FETCHENV.get_env ( - self.DISTROOT.get_distdir ( self.name ).get_root() - ) - ): + if not nosync and not self.fetch_src_for_ebuild ( efile_dest ): raise Exception ( "doebuild_fetch() failed." ) # imported ebuilds cannot be used for generating metadata.xml @@ -810,7 +821,6 @@ class PackageDirBase ( object ): # generate hashes here (benefit from threading) # FIXME/TODO: ^ actually faster? - ##p_info.make_hashes ( self.HASHES ) p_info.make_distmap_hash() self._need_manifest = True @@ -884,6 +894,7 @@ class PackageDirBase ( object ): return True else: return False + elif ( hasattr ( self, '_write_import_manifest' ) and self._write_import_manifest() 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 3CB341381F3 for ; Wed, 10 Jul 2013 15:10:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BCA0AE0A5B; Wed, 10 Jul 2013 15:10:47 +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 D9E7BE0A43 for ; Wed, 10 Jul 2013 15:10:46 +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 BD3C433E8F0 for ; Wed, 10 Jul 2013 15:10:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 56079E5470 for ; Wed, 10 Jul 2013 15:10:42 +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: <1373465378.45b5e9f8e6aac6d6729e96b46849f7bf4e9c9f56.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:gsoc13/next commit in: roverlay/overlay/pkgdir/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/overlay/pkgdir/packagedir_base.py X-VCS-Directories: roverlay/overlay/pkgdir/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 45b5e9f8e6aac6d6729e96b46849f7bf4e9c9f56 X-VCS-Branch: gsoc13/next Date: Wed, 10 Jul 2013 15:10:42 +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: 34ec283c-8ea9-4443-ab6a-776ae4a8599a X-Archives-Hash: 84bf361c44e060287dc60a05722615d0 Message-ID: <20130710151042.lMzHurV6tn4jOWxMVLOsEHisNDqeicIN0lGmJ93iZlY@z> commit: 45b5e9f8e6aac6d6729e96b46849f7bf4e9c9f56 Author: André Erdmann mailerd de> AuthorDate: Wed Jul 10 14:09:38 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Wed Jul 10 14:09:38 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=45b5e9f8 pkgdir_base: fixup * unused variables removed: HASHES, SUPPRESS_EXCEPTIONS * added DOEBUILD_FETCH to set the doebuild fetch function (class-wide) * get_distdir(), fetch_src_for_ebuild() added --- roverlay/overlay/pkgdir/packagedir_base.py | 39 +++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/roverlay/overlay/pkgdir/packagedir_base.py b/roverlay/overlay/pkgdir/packagedir_base.py index 63adfb4..53ebc42 100644 --- a/roverlay/overlay/pkgdir/packagedir_base.py +++ b/roverlay/overlay/pkgdir/packagedir_base.py @@ -1,6 +1,6 @@ # R overlay -- overlay package, package directory # -*- coding: utf-8 -*- -# Copyright (C) 2012 André Erdmann +# Copyright (C) 2012, 2013 André Erdmann # Distributed under the terms of the GNU General Public License; # either version 2 of the License, or (at your option) any later version. @@ -37,6 +37,8 @@ import roverlay.overlay.additionsdir import roverlay.overlay.pkgdir.distroot.static import roverlay.overlay.pkgdir.metadata +# TODO: proper reading of $SRC_URI when importing (or scanning) ebuilds +# This would make manifest creation being more controlled class PackageDirBase ( object ): """The PackageDir base class that implements most functionality except @@ -44,10 +46,9 @@ class PackageDirBase ( object ): #DISTROOT = #DISTMAP = - EBUILD_SUFFIX = '.ebuild' #FETCHENV = - #HASHES = - SUPPRESS_EXCEPTIONS = True + + EBUILD_SUFFIX = '.ebuild' # MANIFEST_THREADSAFE (tri-state) # * None -- unknown (e.g. write_manifest() not implemented) @@ -56,6 +57,12 @@ class PackageDirBase ( object ): # MANIFEST_THREADSAFE = None + # DOEBUILD_FETCH + # doebuild function that fetches $SRC_URI + # can be overridden by subclasses if e.g. on-the-fly manifest creation + # is required, too + DOEBUILD_FETCH = roverlay.tools.ebuild.doebuild_fetch + @classmethod def init_base_cls ( cls ): # env for calling "ebuild fetch" @@ -66,9 +73,6 @@ class PackageDirBase ( object ): cls.DISTROOT = roverlay.overlay.pkgdir.distroot.static.get_configured() cls.DISTMAP = roverlay.recipe.distmap.access() - # FIXME/TODO: config - #cls.HASHES = frozenset ({ 'sha256', 'sha512', 'whirlpool', }) - cls.HASHES = frozenset ({ 'sha256', }) cls.FETCHENV = fetch_env # --- end of init_cls (...) --- @@ -581,6 +585,18 @@ class PackageDirBase ( object ): return success # --- end of write (...) --- + def get_distdir ( self ): + return self.DISTROOT.get_distdir ( self.name ) + # --- end of get_distdir (...) --- + + def fetch_src_for_ebuild ( self, efile ): + return self.DOEBUILD_FETCH ( + ebuild_file = efile, + logger = self.logger, + env = self.FETCHENV.get_env ( self.get_distdir().get_root() ) + ) + # --- end of fetch_src_for_ebuild (...) --- + def import_ebuilds ( self, eview, overwrite, nosync=False ): """Imports ebuilds from an additions dir into this package dir. @@ -625,12 +641,7 @@ class PackageDirBase ( object ): self._need_manifest = True # fetch SRC_URI using ebuild(1) - if not nosync and not roverlay.tools.ebuild.doebuild_fetch ( - efile_dest, self.logger, - self.FETCHENV.get_env ( - self.DISTROOT.get_distdir ( self.name ).get_root() - ) - ): + if not nosync and not self.fetch_src_for_ebuild ( efile_dest ): raise Exception ( "doebuild_fetch() failed." ) # imported ebuilds cannot be used for generating metadata.xml @@ -810,7 +821,6 @@ class PackageDirBase ( object ): # generate hashes here (benefit from threading) # FIXME/TODO: ^ actually faster? - ##p_info.make_hashes ( self.HASHES ) p_info.make_distmap_hash() self._need_manifest = True @@ -884,6 +894,7 @@ class PackageDirBase ( object ): return True else: return False + elif ( hasattr ( self, '_write_import_manifest' ) and self._write_import_manifest()