From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1ShkfU-0004Me-Up for garchives@archives.gentoo.org; Thu, 21 Jun 2012 16:55:41 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F0D86E0B18; Thu, 21 Jun 2012 16:55:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B11D0E0B18 for ; Thu, 21 Jun 2012 16:55:08 +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 E22291B4036 for ; Thu, 21 Jun 2012 16:55:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 9AFABE5444 for ; Thu, 21 Jun 2012 16:55:04 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1340297582.ceb4dbb9c99d05dc191acf2182e29ef3d3d55038.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: / X-VCS-Repository: proj/R_overlay X-VCS-Files: run_overlaycreation.py X-VCS-Directories: / X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: ceb4dbb9c99d05dc191acf2182e29ef3d3d55038 X-VCS-Branch: master Date: Thu, 21 Jun 2012 16:55:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 82cb3642-6866-4d08-bef4-5fb7fe582a26 X-Archives-Hash: 0c3b586380d7e2a3a599e28f73afefb1 commit: ceb4dbb9c99d05dc191acf2182e29ef3d3d55038 Author: Andr=C3=A9 Erdmann mailerd de> AuthorDate: Thu Jun 21 16:53:02 2012 +0000 Commit: Andr=C3=A9 Erdmann mailerd de> CommitDate: Thu Jun 21 16:53:02 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/R_overlay.git= ;a=3Dcommit;h=3Dceb4dbb9 replaced run_overlaycreation test script * run_overlaycreation uses OverlayCreator now, usage is ./run_overlaycreation [--show] [--write] [--help] modified: run_overlaycreation.py --- run_overlaycreation.py | 127 +++++++++++++++++-------------------------= ----- 1 files changed, 46 insertions(+), 81 deletions(-) diff --git a/run_overlaycreation.py b/run_overlaycreation.py index da86dc6..2429dd5 100755 --- a/run_overlaycreation.py +++ b/run_overlaycreation.py @@ -1,82 +1,47 @@ #!/usr/bin/env python3 - -import os.path -import sys -import logging - -import roverlay.static.depres - -from roverlay import config -from roverlay.packageinfo import PackageInfo -from roverlay.ebuild.creation import EbuildCreation -from roverlay.overlay import Overlay -from roverlay.depres import simpledeprule, listeners - -# -- prepare - -WRITE_OVERLAY =3D False -if len ( sys.argv ) > 1: - if sys.argv [1] =3D=3D '--write': - WRITE_OVERLAY =3D True - - -# the package used for testing -seewave_f =3D os.path.abspath ( 'examples/packages/seewave_1.6.3.tar.gz'= ) -# the overlay dir -overlay_d =3D "/tmp/R-Overlay_0" -config.access().inject ( "OVERLAY.dir", overlay_d ) - -# dep resolver setup -resolver =3D roverlay.static.depres.resolver() -# log everything -resolver.set_logmask ( -1 ) - -# add simple rules to the resolver -rulepool =3D simpledeprule.SimpleDependencyRulePool ( - 'test pool', - filepath=3Dos.path.abspath ( 'simple-deprules.conf' ), - priority=3D25 -) - -resolver.add_rulepool ( rulepool ) - - -# eclass files -eclass_list =3D ( 'R-packages', ) -eclass_files =3D tuple ( os.path.abspath ( os.path.join ( 'eclass', "%s.= eclass" % x ) ) for x in eclass_list ) - -#for e in eclass_files: -# if not os.path.isfile ( e ): -# raise Exception ( "eclass %s is missing!" % e ) - - -o =3D Overlay ( - name=3D"R-packages", - logger=3DNone, - directory=3DNone, - default_category=3D"sci-R", - eclass_files=3Declass_files -) - -p =3D PackageInfo ( filepath=3Dseewave_f ) -e =3D EbuildCreation ( p ) - -# -- run - -e.run() - -resolver.close() - -if p ['ebuild'] is None: - sys.stderr.write ( "No ebuild created!\n" ) -else: - try: - o.add ( p ) - o.show() - if WRITE_OVERLAY: - o.write() - sys.stderr.write ( "Overlay written - directory is '%s'.\n" % overlay= _d ) - except Exception as e: - sys.stderr.write ( "Overlay creation/update failed!\n" ) - raise - +from sys import exit +from sys import argv as ARGV + +if True in ( x in ARGV for x in ( '--help', '-h', '?' ) ): + print ( '\n'.join ( ( + "usage: %s " % ARGV[0], + "* pkgs ::=3D [pkg]*", + "* pkg ::=3D