From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 121C91382C5 for ; Mon, 19 Feb 2018 19:20:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1EAD7E09C9; Mon, 19 Feb 2018 19:20:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F1E58E09C9 for ; Mon, 19 Feb 2018 19:20:16 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C0E84335C2A for ; Mon, 19 Feb 2018 19:20:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F16EC1DF for ; Mon, 19 Feb 2018 19:20:04 +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: <1519067904.7a6099f046a0c1f7d45751daf13c1e68253878aa.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/search.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 7a6099f046a0c1f7d45751daf13c1e68253878aa X-VCS-Branch: master Date: Mon, 19 Feb 2018 19:20: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 X-Archives-Salt: 64866894-f7a1-44e8-a980-dfe5f4f54a26 X-Archives-Hash: 8b5fb627fcdac5d1716240f15ef8358e commit: 7a6099f046a0c1f7d45751daf13c1e68253878aa Author: Zac Medico gentoo org> AuthorDate: Sun Feb 18 21:19:39 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Feb 19 19:18:24 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7a6099f0 emerge --search: use slash to auto-detect category (bug 647940) Since search strings containing a slash do no work unless category match mode is enabled, use slash to auto-detect category match mode, so that users do not have to prefix the search string with the special @ symbol. Bug: https://bugs.gentoo.org/647940 Reviewed-by: Brian Dolbec gentoo.org> Reviewed-by: M. J. Everitt iee.org> pym/_emerge/search.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py index 36897fb15..eb52b2ca3 100644 --- a/pym/_emerge/search.py +++ b/pym/_emerge/search.py @@ -256,6 +256,10 @@ class search(object): if self.searchkey.startswith('@'): match_category = 1 self.searchkey = self.searchkey[1:] + # Auto-detect category match mode (@ symbol can be deprecated + # after this is available in a stable version of portage). + if '/' in self.searchkey: + match_category = 1 fuzzy = False if regexsearch: self.searchre=re.compile(self.searchkey,re.I)