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 5AA7813888B for ; Tue, 5 Feb 2013 17:48:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B079E21C011; Tue, 5 Feb 2013 17:48:28 +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 27BEE21C011 for ; Tue, 5 Feb 2013 17:48:27 +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 2733233DF20 for ; Tue, 5 Feb 2013 17:48:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 822D7E4095 for ; Tue, 5 Feb 2013 17:48:24 +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: <1360086387.d269d111a7b37dae7824594a8c2f8c060a7a67a5.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: /, roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay.py roverlay/argutil.py X-VCS-Directories: / roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: d269d111a7b37dae7824594a8c2f8c060a7a67a5 X-VCS-Branch: master Date: Tue, 5 Feb 2013 17:48:24 +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: d6edb796-abe0-47ae-9a91-d3521d308102 X-Archives-Hash: 0d616a26bc3fe6b5f562eb8a952b7229 commit: d269d111a7b37dae7824594a8c2f8c060a7a67a5 Author: André Erdmann mailerd de> AuthorDate: Tue Feb 5 17:46:27 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Tue Feb 5 17:46:27 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=d269d111 roverlay: --print-package-rules (--ppr) Added new arg --print-package-rules (--ppr) that prints the package rules to stdout after reading them. Similar to --print-config, roverlay will exit afterwards. --- roverlay.py | 15 +++++++++++++++ roverlay/argutil.py | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/roverlay.py b/roverlay.py index a13be00..d18a987 100755 --- a/roverlay.py +++ b/roverlay.py @@ -259,6 +259,21 @@ def roverlay_main(): die ( "Cannot print config!" ) EXIT_AFTER_CONFIG = True + if OPTION ( 'print_package_rules' ): + # no try-/catch block here + + import roverlay.packagerules.rules + + HLINE = "".rjust ( 79, '-' ) + print ( HLINE ) + print ( + str ( roverlay.packagerules.rules.PackageRules.get_configured() ) + ) + print ( HLINE ) + + EXIT_AFTER_CONFIG = True + + # -- end of EXIT_AFTER_CONFIG entries if 'EXIT_AFTER_CONFIG' in locals() and EXIT_AFTER_CONFIG: pass diff --git a/roverlay/argutil.py b/roverlay/argutil.py index ceb8baa..d7d8444 100644 --- a/roverlay/argutil.py +++ b/roverlay/argutil.py @@ -127,6 +127,14 @@ def get_parser ( command_map, default_config_file, default_command='create' ): ) arg ( + '-P', '--package-rules', default=argparse.SUPPRESS, + action='append', + help="package rule file, can be specified more than once.", + type=is_fs_file_or_dir, + metavar='', + ) + + arg ( '--distdir', '--from', default=argparse.SUPPRESS, action='append', help=''' @@ -236,6 +244,12 @@ def get_parser ( command_map, default_config_file, default_command='create' ): ) arg ( + '--print-package-rules', '--ppr', + help="print package rules after parsing them and exit", + **opt_in + ) + + arg ( '--list-config-entries', '--help-config', help="list all known config entries", **opt_in @@ -320,6 +334,7 @@ def parse_argv ( command_map, **kw ): print_stats = p.stats, print_config = p.print_config, list_config = p.list_config_entries, + print_package_rules = p.print_package_rules, force_distroot = p.force_distroot, skip_manifest = p.no_manifest, incremental = p.incremental, @@ -339,6 +354,9 @@ def parse_argv ( command_map, **kw ): if given ( 'repo_config' ): doconf ( p.repo_config, 'REPO.config_files' ) + if given ( 'package_rules' ): + doconf ( p.package_rules, 'PACKAGE_RULES.files' ) + if given ( 'distroot' ): doconf ( p.distroot, 'distfiles.root' )