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 95117138200 for ; Wed, 10 Jul 2013 16:17:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 82898E0A7C; Wed, 10 Jul 2013 16:17:07 +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 0C973E0A7C for ; Wed, 10 Jul 2013 16:17:06 +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 AC63033E916 for ; Wed, 10 Jul 2013 16:16:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 4F5C0E547F for ; Wed, 10 Jul 2013 16:16:56 +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: <1373468836.d0803a228f07e2c535dac48b21d07499d0a6e8db.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_portagemanifest.py X-VCS-Directories: roverlay/overlay/pkgdir/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: d0803a228f07e2c535dac48b21d07499d0a6e8db X-VCS-Branch: master Date: Wed, 10 Jul 2013 16:16:56 +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: 9c87212c-af3a-4f04-8c80-135be08c3e3e X-Archives-Hash: 8bd6bb508873c6342be2ffbbf9636b7f commit: d0803a228f07e2c535dac48b21d07499d0a6e8db Author: André Erdmann mailerd de> AuthorDate: Wed Jul 10 15:07:16 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Wed Jul 10 15:07:16 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=d0803a22 remove portagemanifest --- .../overlay/pkgdir/packagedir_portagemanifest.py | 183 --------------------- 1 file changed, 183 deletions(-) diff --git a/roverlay/overlay/pkgdir/packagedir_portagemanifest.py b/roverlay/overlay/pkgdir/packagedir_portagemanifest.py deleted file mode 100644 index f4527a1..0000000 --- a/roverlay/overlay/pkgdir/packagedir_portagemanifest.py +++ /dev/null @@ -1,183 +0,0 @@ -# R overlay -- overlay package, package directory (portage manifest) -# -*- coding: utf-8 -*- -# Copyright (C) 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. - -__all__ = [ 'PackageDir', ] - -import os -import shlex - -import portage.manifest -import portage.exception - -import logging -logging.getLogger ( __name__ ).warning ( - "experimental code, importing ebuilds doesn't work!" -) -del logging - -import roverlay.config -import roverlay.strutil -import roverlay.packageinfo -import roverlay.overlay.pkgdir.packagedir_base -import roverlay.overlay.pkgdir.distroot - -class PackageDir ( roverlay.overlay.pkgdir.packagedir_base.PackageDirBase ): - # FIXME: portagemanifest is broken, it cannot create Manifest files for - # package dirs with imported ebuilds - - MANIFEST_THREADSAFE = True - - def import_ebuilds ( self, *args, **kwargs ): - raise NotImplementedError ( - "ebuild imports not supported by portagemanifest!" - ) - # --- end of import_ebuilds (...) --- - - def _scan_add_package ( self, efile, pvr ): - """Called for each ebuild that is found during scan(). - Creates a PackageInfo for the ebuild and adds it to self._packages. - - arguments: - * efile -- full path to the ebuild file - * pvr -- version ($PVR) of the ebuild - """ - - # read SRC_URI from the ebuild file which is the only way to get - # the correct package name - src_uri = None - with open ( efile, 'r' ) as FH: - reader = shlex.shlex ( FH ) - reader.whitespace_split = False - reader.wordchars += ' ,./$()[]:+-@*~<>' - - # assumption: only one SRC_URI= statement per ebuild - # (true for roverlay ebuilds) - mode = 0 - token = reader.get_token() - while token: - if mode == 0 and token == 'SRC_URI': - mode = 1 - elif mode == 1 and token == '=': - mode = 2 - elif mode == 2: - mode = 3 - src_uri = tuple ( - roverlay.strutil.split_whitespace ( - roverlay.strutil.unquote ( token ) - ) - ) - - # break loop if SRC_URI parsed - token = reader.get_token() if mode < 3 else None - # --- while; - del token, reader, mode - # --- with; - - # another assumption: - # name of the R package is src_uri[2] if src_uri[1] == '->', else [0] - # - if src_uri: - # > 2, > 1? ebuild would be broken if $SRC_URI ends with '->' - #if len ( src_uri ) > 2 and src_uri [1] == '->': - if len ( src_uri ) > 1 and src_uri [1] == '->': - package_filename = src_uri[2] - else: - package_filename = src_uri[0].rpartition ( '/' ) [2] - - p = roverlay.packageinfo.PackageInfo ( - physical_only=True, pvr=pvr, ebuild_file=efile, - package_filename=package_filename - ) - else: - p = roverlay.packageinfo.PackageInfo ( - physical_only=True, pvr=pvr, ebuild_file=efile - ) - # --- if; - - self._packages [ p ['ebuild_verstr'] ] = p - # --- end of _scan_add_package (...) --- - - def _write_manifest ( self, pkgs_for_manifest ): - """Generates and writes the Manifest file for this package. - - expects: called after writing metadata/ebuilds - - returns: True - """ - - # TODO: this needs proper testing - # * the written Manifest file must not differ from the one generated by - # ebuild(1) (the order of the entries is not important, though) - # * safe for incremental usage? - # * correct usage of the portage libs (also see other comments below) - # * what happens if an ebuild has been removed? - # * ... - # - - distdir = self.DISTROOT.get_distdir ( self.name ) - - # allow_missing=True -- don't write empty Manifest files - manifest = portage.manifest.Manifest ( - self.physical_location, - distdir.get_root(), - allow_missing=True, - ) - - # metadata.xml - #os.path.basename ( self._metadata.filepath ) - try: - manifest.addFile ( 'MISC', 'metadata.xml' ) - except portage.exception.FileNotFound as f404: - # package dir has no metadata.xml file - # - # This happens for a few package dirs that dont contain any package - # with enough information required for metadata creation - # - # packagedir_ebuildmanifest accepts this case without complaining, - # so ignore it here, too. - # - pass - - - for p in pkgs_for_manifest: - - ebuild_filename = p ['ebuild_filename'] - package_filename = p ['package_src_destpath'] - - if not manifest.hasFile ( 'EBUILD', ebuild_filename ): - manifest.addFile ( 'EBUILD', ebuild_filename ) - - if not manifest.hasFile ( 'DIST', package_filename ): - distdir.add ( p ['package_file'], package_filename, p ) - manifest.addFile ( - 'DIST', - package_filename, - # TODO: - # ignoreMissing for DIST files, else addFile raises - # FileNotFound -- is this the correct way to add DIST files? - ignoreMissing=True - ) - else: - # ebuildmanifest adds all package files to the distdir without - # doing the check above (if hasFile()) - # be "fully compatible" and do that here, too - try: - distdir.add ( p ['package_file'], package_filename, p ) - except Exception as err: - self.logger.exception ( err ) - - # ??? FIXME: (read) portage api docs - # - # manifest.create -- recreate from scratch (required?) - # -> assumeDistHashesSometimes: - # use existing checksums for non-existent DIST files (required?) - # - #manifest.create ( assumeDistHashesSometimes=True ) - #manifest.create ( assumeDistHashesSometimes=False ) - - manifest.write() - return True - # --- end of write_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 74BA81381F3 for ; Wed, 10 Jul 2013 15:10:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 65F3DE0A7D; Wed, 10 Jul 2013 15:10:48 +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 DEF5CE0A7C for ; Wed, 10 Jul 2013 15:10: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 8893B33E91A for ; Wed, 10 Jul 2013 15:10:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 09D02E547B for ; Wed, 10 Jul 2013 15:10: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: <1373468836.d0803a228f07e2c535dac48b21d07499d0a6e8db.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_portagemanifest.py X-VCS-Directories: roverlay/overlay/pkgdir/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: d0803a228f07e2c535dac48b21d07499d0a6e8db X-VCS-Branch: gsoc13/next Date: Wed, 10 Jul 2013 15:10: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: 64958a3f-b550-4aa7-8218-0234bc9dc96d X-Archives-Hash: bfcce73d3b41fb25410d05fb8bfe3a98 Message-ID: <20130710151044.LNMV7uD7eg-BFTVl2kUM9Hs1-IQAquAwgIRmZ-U5hBY@z> commit: d0803a228f07e2c535dac48b21d07499d0a6e8db Author: André Erdmann mailerd de> AuthorDate: Wed Jul 10 15:07:16 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Wed Jul 10 15:07:16 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=d0803a22 remove portagemanifest --- .../overlay/pkgdir/packagedir_portagemanifest.py | 183 --------------------- 1 file changed, 183 deletions(-) diff --git a/roverlay/overlay/pkgdir/packagedir_portagemanifest.py b/roverlay/overlay/pkgdir/packagedir_portagemanifest.py deleted file mode 100644 index f4527a1..0000000 --- a/roverlay/overlay/pkgdir/packagedir_portagemanifest.py +++ /dev/null @@ -1,183 +0,0 @@ -# R overlay -- overlay package, package directory (portage manifest) -# -*- coding: utf-8 -*- -# Copyright (C) 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. - -__all__ = [ 'PackageDir', ] - -import os -import shlex - -import portage.manifest -import portage.exception - -import logging -logging.getLogger ( __name__ ).warning ( - "experimental code, importing ebuilds doesn't work!" -) -del logging - -import roverlay.config -import roverlay.strutil -import roverlay.packageinfo -import roverlay.overlay.pkgdir.packagedir_base -import roverlay.overlay.pkgdir.distroot - -class PackageDir ( roverlay.overlay.pkgdir.packagedir_base.PackageDirBase ): - # FIXME: portagemanifest is broken, it cannot create Manifest files for - # package dirs with imported ebuilds - - MANIFEST_THREADSAFE = True - - def import_ebuilds ( self, *args, **kwargs ): - raise NotImplementedError ( - "ebuild imports not supported by portagemanifest!" - ) - # --- end of import_ebuilds (...) --- - - def _scan_add_package ( self, efile, pvr ): - """Called for each ebuild that is found during scan(). - Creates a PackageInfo for the ebuild and adds it to self._packages. - - arguments: - * efile -- full path to the ebuild file - * pvr -- version ($PVR) of the ebuild - """ - - # read SRC_URI from the ebuild file which is the only way to get - # the correct package name - src_uri = None - with open ( efile, 'r' ) as FH: - reader = shlex.shlex ( FH ) - reader.whitespace_split = False - reader.wordchars += ' ,./$()[]:+-@*~<>' - - # assumption: only one SRC_URI= statement per ebuild - # (true for roverlay ebuilds) - mode = 0 - token = reader.get_token() - while token: - if mode == 0 and token == 'SRC_URI': - mode = 1 - elif mode == 1 and token == '=': - mode = 2 - elif mode == 2: - mode = 3 - src_uri = tuple ( - roverlay.strutil.split_whitespace ( - roverlay.strutil.unquote ( token ) - ) - ) - - # break loop if SRC_URI parsed - token = reader.get_token() if mode < 3 else None - # --- while; - del token, reader, mode - # --- with; - - # another assumption: - # name of the R package is src_uri[2] if src_uri[1] == '->', else [0] - # - if src_uri: - # > 2, > 1? ebuild would be broken if $SRC_URI ends with '->' - #if len ( src_uri ) > 2 and src_uri [1] == '->': - if len ( src_uri ) > 1 and src_uri [1] == '->': - package_filename = src_uri[2] - else: - package_filename = src_uri[0].rpartition ( '/' ) [2] - - p = roverlay.packageinfo.PackageInfo ( - physical_only=True, pvr=pvr, ebuild_file=efile, - package_filename=package_filename - ) - else: - p = roverlay.packageinfo.PackageInfo ( - physical_only=True, pvr=pvr, ebuild_file=efile - ) - # --- if; - - self._packages [ p ['ebuild_verstr'] ] = p - # --- end of _scan_add_package (...) --- - - def _write_manifest ( self, pkgs_for_manifest ): - """Generates and writes the Manifest file for this package. - - expects: called after writing metadata/ebuilds - - returns: True - """ - - # TODO: this needs proper testing - # * the written Manifest file must not differ from the one generated by - # ebuild(1) (the order of the entries is not important, though) - # * safe for incremental usage? - # * correct usage of the portage libs (also see other comments below) - # * what happens if an ebuild has been removed? - # * ... - # - - distdir = self.DISTROOT.get_distdir ( self.name ) - - # allow_missing=True -- don't write empty Manifest files - manifest = portage.manifest.Manifest ( - self.physical_location, - distdir.get_root(), - allow_missing=True, - ) - - # metadata.xml - #os.path.basename ( self._metadata.filepath ) - try: - manifest.addFile ( 'MISC', 'metadata.xml' ) - except portage.exception.FileNotFound as f404: - # package dir has no metadata.xml file - # - # This happens for a few package dirs that dont contain any package - # with enough information required for metadata creation - # - # packagedir_ebuildmanifest accepts this case without complaining, - # so ignore it here, too. - # - pass - - - for p in pkgs_for_manifest: - - ebuild_filename = p ['ebuild_filename'] - package_filename = p ['package_src_destpath'] - - if not manifest.hasFile ( 'EBUILD', ebuild_filename ): - manifest.addFile ( 'EBUILD', ebuild_filename ) - - if not manifest.hasFile ( 'DIST', package_filename ): - distdir.add ( p ['package_file'], package_filename, p ) - manifest.addFile ( - 'DIST', - package_filename, - # TODO: - # ignoreMissing for DIST files, else addFile raises - # FileNotFound -- is this the correct way to add DIST files? - ignoreMissing=True - ) - else: - # ebuildmanifest adds all package files to the distdir without - # doing the check above (if hasFile()) - # be "fully compatible" and do that here, too - try: - distdir.add ( p ['package_file'], package_filename, p ) - except Exception as err: - self.logger.exception ( err ) - - # ??? FIXME: (read) portage api docs - # - # manifest.create -- recreate from scratch (required?) - # -> assumeDistHashesSometimes: - # use existing checksums for non-existent DIST files (required?) - # - #manifest.create ( assumeDistHashesSometimes=True ) - #manifest.create ( assumeDistHashesSometimes=False ) - - manifest.write() - return True - # --- end of write_manifest (...) ---