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 25C161381F3 for ; Mon, 12 Aug 2013 23:09:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1E97CE0AF4; Mon, 12 Aug 2013 23:09:23 +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 8DD9AE0AF3 for ; Mon, 12 Aug 2013 23:09:22 +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 6C30133EA86 for ; Mon, 12 Aug 2013 23:09:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id DC30EE468F for ; Mon, 12 Aug 2013 23:09:19 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1376348602.db095dbbbb7cf51b4a89e7b961dc84c1a2af2402.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/egencache X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: db095dbbbb7cf51b4a89e7b961dc84c1a2af2402 X-VCS-Branch: master Date: Mon, 12 Aug 2013 23:09:19 +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: fb2bb626-4b2f-4e81-b362-a6513542a9d1 X-Archives-Hash: 403c811d6e517d2fa41765d37c34950f commit: db095dbbbb7cf51b4a89e7b961dc84c1a2af2402 Author: Zac Medico gentoo org> AuthorDate: Mon Aug 12 23:01:20 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Aug 12 23:03:22 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=db095dbb egencache: allow missing --repo if exactly 1 repo --- bin/egencache | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/egencache b/bin/egencache index 45d4fbd..3859a06 100755 --- a/bin/egencache +++ b/bin/egencache @@ -207,9 +207,6 @@ def parse_args(args): parser.error("Write access denied: --cache-dir='%s'" % \ (options.cache_dir,)) - if options.repo is None: - parser.error("--repo option is required") - if options.portdir is not None: writemsg_level("egencache: warning: --portdir option is deprecated in favor of --repositories-configuration option\n", level=logging.WARNING, noiselevel=-1) @@ -894,6 +891,16 @@ def egencache_main(args): parser.error('No action specified') return 1 + if options.repo is None: + if len(settings.repositories.prepos) == 2: + for repo in settings.repositories: + if repo.name != "DEFAULT": + options.repo = repo.name + break + + if options.repo is None: + parser.error("--repo option is required") + repo_path = settings.repositories.treemap.get(options.repo) if repo_path is None: parser.error("Unable to locate repository named '%s'" % (options.repo,))