Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 467826 - portage incorrectly matches certain atoms when using =...*
Summary: portage incorrectly matches certain atoms when using =...*
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 472632
  Show dependency tree
 
Reported: 2013-04-29 03:53 UTC by SpanKY
Modified: 2013-06-09 01:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2013-04-29 03:53:54 UTC
while writing some code in qpkg for testing version atoms, i noticed portage gets this scenario wrong:
  $ python -c 'import portage;
    print portage.dep.match_from_list("=c/p-1-r1*", ["c/p-1_alpha1"])'
  ['c/p-1_alpha1']
that should of course be []

you can see this with a simple ebuild too:
  $ cd /usr/portage/sys-libs/ldb
  $ mv ldb-1.1.12.ebuild ldb-1_alpha1.ebuild
  $ rm ldb-1.*
  $ emerge =ldb-1-r1* -qpv --nodeps
  [ebuild  N    ] sys-libs/ldb-1_alpha1  USE="-doc"

simple update to the test suite to catch this (the pym/portage/tests/dep/test_match_from_list.py file):
+           ("=cat/pkg-1-r1*", ["cat/pkg-1_alpha1"], []),

tested 2.2.0_alpha170 and latest git tree -- both fail
Comment 1 SpanKY gentoo-dev 2013-04-29 22:15:13 UTC
another example:
  c/a-1 != =c/a-1.0*

imo, that should match, but portage doesn't think so currently
Comment 2 Zac Medico gentoo-dev 2013-06-08 23:39:58 UTC
(In reply to SpanKY from comment #1)
> another example:
>   c/a-1 != =c/a-1.0*
> 
> imo, that should match, but portage doesn't think so currently

Well, PMS specifies "string prefix comparison" for this case:

  http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-840008.2.6.1
Comment 3 Zac Medico gentoo-dev 2013-06-09 00:26:34 UTC
(In reply to SpanKY from comment #0)
> while writing some code in qpkg for testing version atoms, i noticed portage
> gets this scenario wrong:
>   $ python -c 'import portage;
>     print portage.dep.match_from_list("=c/p-1-r1*", ["c/p-1_alpha1"])'
>   ['c/p-1_alpha1']
> that should of course be []

This is fixed in git:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=889e19d27ac978dbbc9699bac152657675569ebd
Comment 4 Zac Medico gentoo-dev 2013-06-09 01:42:58 UTC
This is fixed in 2.1.12.4 and 2.2.0_alpha179.

For comment #1, we might consider revising PMS?