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 1QTy5Q-0003oy-CK for garchives@archives.gentoo.org; Tue, 07 Jun 2011 15:20:56 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8E1841C113; Tue, 7 Jun 2011 15:20:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5EE581C114 for ; Tue, 7 Jun 2011 15:20:34 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id DD1AB1B4019 for ; Tue, 7 Jun 2011 15:20:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id D23CC80040 for ; Tue, 7 Jun 2011 15:20:32 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: PMSTestSuite/cli.py X-VCS-Directories: PMSTestSuite/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: cc9f31d4c7bd76e650b6bfeb3227fa6bd0d8c53f Date: Tue, 7 Jun 2011 15:20:32 +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: X-Archives-Hash: da6d519956764e37afb7c44eb5ad2215 commit: cc9f31d4c7bd76e650b6bfeb3227fa6bd0d8c53f Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Tue Jun 7 15:17:59 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Tue Jun 7 15:17:59 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3Dcc9f31d4 Support --repository-name. --- PMSTestSuite/cli.py | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/PMSTestSuite/cli.py b/PMSTestSuite/cli.py index bfe4713..7901d85 100644 --- a/PMSTestSuite/cli.py +++ b/PMSTestSuite/cli.py @@ -36,7 +36,8 @@ class PMSTestSuiteCLI(object): """ opt =3D OptionParser(version =3D PV) =20 - # XXX: -r for getting through PM's repo_name + opt.add_option('-r', '--repository-name', dest=3D'repo_name', + help=3D'Name of the repository to store ebuilds in') opt.add_option('-R', '--repository-path', dest=3D'repo_path', help=3D'Path to the repository to store ebuilds in') opt.add_option('-l', '--library', dest=3D'library_name', @@ -62,8 +63,8 @@ class PMSTestSuiteCLI(object): opt.prog =3D os.path.basename(prog) (opts, args) =3D opt.parse_args(list(args)) =20 - if not opts.repo_path: - opt.error('--repository-path must be specified') + if opts.repo_path and opts.repo_name: + opt.error('--repository-path and --repository-name can not be used to= gether') =20 for x in get_package_managers(): if x.name =3D=3D opts.pm: @@ -84,8 +85,13 @@ class PMSTestSuiteCLI(object): os.umask(077) =20 try: - self.repository =3D NewEbuildRepository(opts.repo_path, 'pms-test-sui= te') - except (OSError, IOError, ValueError) as e: + if opts.repo_path: + self.repository =3D NewEbuildRepository(opts.repo_path, 'pms-test-su= ite') + else: + if not opts.repo_name: + opts.repo_name =3D 'pms-test-suite' + self.repository =3D self.pm.get_repository(opts.repo_name) + except (OSError, IOError, KeyError, ValueError) as e: opt.error('Repository open failed: %s' % e) =20 try: