The problem is in: /usr/lib/python3.7/site-packages/portage/dbapi/cpv_expand.py this code here: if len(matches) > 1: virtual_name_collision = False if len(matches) > 1: for x in matches: print("m", mycpv, x) if not x.startswith(("acct-group/", "acct-user/", "virtual/")): # Assume that the non-virtual is desired. This helps # avoid the ValueError for invalid deps that come from # installed packages (during reverse blocker detection, # for example). mykey = x print("n", mycpv, x) else: print("o", mycpv, x) virtual_name_collision = True if not virtual_name_collision: # AmbiguousPackageName inherits from ValueError, # for backward compatibility with calling code # that already handles ValueError. raise AmbiguousPackageName(matches) elif matches: mykey=matches[0] I added the 3 print() statements. Reproducible: Always Steps to Reproduce: 1. equery m git 2. equery m glib Actual Results: 1. # equery m git m git acct-group/git o git acct-group/git m git acct-user/git o git acct-user/git m git dev-vcs/git n git dev-vcs/git m git dev-haskell/git n git dev-haskell/git m git dev-ruby/git n git dev-ruby/git gentoolkit/query.py git dev-ruby/git-1.7.0 m git acct-group/git o git acct-group/git m git acct-user/git o git acct-user/git m git dev-vcs/git n git dev-vcs/git m git dev-haskell/git n git dev-haskell/git m git dev-ruby/git n git dev-ruby/git * dev-ruby/git [gentoo] Maintainer: ruby@gentoo.org (Gentoo Ruby Project) Upstream: Remote-ID: schacon/ruby-git ID: github Homepage: https://github.com/schacon/ruby-git Location: /var/db/repos/gentoo/dev-ruby/git Keywords: 1.7.0:0: amd64 Keywords: 2.29.2:0: ~alpha ~amd64 ~amd64-linux ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc-aix ~ppc-macos ~ppc64 ~riscv ~s390 ~sparc ~sparc-solaris ~sparc64-solaris ~x64-cygwin ~x64-macos ~x64-solaris ~x86 ~x86-linux ~x86-macos ~x86-solaris License: MIT 1. (next run) different git package shown: # equery m git m git dev-vcs/git n git dev-vcs/git m git acct-group/git o git acct-group/git m git dev-ruby/git n git dev-ruby/git m git dev-haskell/git n git dev-haskell/git m git acct-user/git o git acct-user/git gentoolkit/query.py git dev-haskell/git-0.3.0 m git dev-vcs/git n git dev-vcs/git m git acct-group/git o git acct-group/git m git dev-ruby/git n git dev-ruby/git m git dev-haskell/git n git dev-haskell/git m git acct-user/git o git acct-user/git * dev-haskell/git [gentoo] Maintainer: haskell@gentoo.org (Gentoo Haskell) Upstream: None specified Homepage: https://github.com/vincenthz/hs-git Location: /var/db/repos/gentoo/dev-haskell/git Keywords: 0.3.0:0/0.3.0: ~amd64 ~x86 Keywords: 2.29.2:0: ~alpha ~amd64 ~amd64-linux ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc-aix ~ppc-macos ~ppc64 ~riscv ~s390 ~sparc ~sparc-solaris ~sparc64-solaris ~x64-cygwin ~x64-macos ~x64-solaris ~x86 ~x86-linux ~x86-macos ~x86-solaris License: BSD 2. this one is correct: # equery m glib m glib dev-haskell/glib m glib dev-libs/glib !!! Ambiguous package name. Choose from: dev-haskell/glib dev-libs/glib Expected Results: "equery m git" should show: !!! Ambiguous package name. Choose from: acct-group/git acct-user/git dev-vcs/git dev-haskell/git dev-ruby/git or maybe not show the "acct" ones in the list, not sure. Portage 3.0.11
Correction, this block: 2. this one is correct: # equery m glib m glib dev-haskell/glib m glib dev-libs/glib !!! Ambiguous package name. Choose from: dev-haskell/glib dev-libs/glib Should've been this: 2. this one is correct: # equery m glib m glib dev-haskell/glib n glib dev-haskell/glib m glib dev-libs/glib n glib dev-libs/glib !!! Ambiguous package name. Choose from: dev-haskell/glib dev-libs/glib
Created attachment 676210 [details, diff] "equery m git" collision fixxage I'll be using this temp-patch until an official one is made, since I cannot wait until then. Results: # equery m git !!! Ambiguous package name. Choose from: dev-haskell/git acct-group/git dev-vcs/git acct-user/git dev-ruby/git # equery m git !!! Ambiguous package name. Choose from: dev-vcs/git acct-group/git acct-user/git dev-ruby/git dev-haskell/git
It happens to other equery commands as equery uses too
(In reply to flippynelle from comment #1) > 2. this one is correct: > # equery m glib > m glib dev-haskell/glib > m glib dev-libs/glib > !!! Ambiguous package name. Choose from: > dev-haskell/glib > dev-libs/glib > I think this is a really assinine response from gentoolkit. When more than one package matches the query, all results should be displayed. Another way to fix this would be to get rid of dev-haskell/* from the main gentoo repo, and stick it in an overlay.
(In reply to cyrillic from comment #4) > (In reply to flippynelle from comment #1) > > 2. this one is correct: > > # equery m glib > > m glib dev-haskell/glib > > m glib dev-libs/glib > > !!! Ambiguous package name. Choose from: > > dev-haskell/glib > > dev-libs/glib > > > > I think this is a really assinine response from gentoolkit. When more than > one package matches the query, all results should be displayed. > > Another way to fix this would be to get rid of dev-haskell/* from the main > gentoo repo, and stick it in an overlay. Pacho, the problem is with changes in portage code that spits out the "!!! Ambiguous package name. Choose from:..." stuff. @zmedico, could cpv_expand get an extra parameter (default False) that gentoolkit could pass to kill the Ambiguos error and return all matches instead?