Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 331413 - man 5 ebuild is unclear about globs/wildcards/* in version specifiers
Summary: man 5 ebuild is unclear about globs/wildcards/* in version specifiers
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Documentation (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 335925
  Show dependency tree
 
Reported: 2010-08-06 10:02 UTC by Dennis Schridde
Modified: 2010-09-04 08:04 UTC (History)
1 user (show)

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 Dennis Schridde 2010-08-06 10:02:40 UTC
Quoting from the manpage:
---
* means match any version of the package so long as the specified base is matched.  So with a version of '2*', we can match '2.1', '2.2', '2.2.1', etc... and not match version '1.0', '3.0', '4.1', etc...
---

It is unclear (and because it is written as a glob, not intuitive either) whether "2*" also matches "20". Is it a special glob adjusted for version numbers, so that it only matches "2 and later, but earlier than 3_pre"? Or is it a plain glob?

I stumbled into this when I tried to write "=...-2.2.0.*" in my /etc/portage/package.keywords, to specifically exclude versions like "2.2.01".

Reproducible: Always
Comment 2 Dennis Schridde 2010-08-06 16:43:38 UTC
PMS 2010-01-18 says about this:
---
= Exactly equal to the specified version. Special exception: if the version specified has an asterisk immediately following it, a string prefix comparison is used instead. When an asterisk is used, the specification must remain valid if the asterisk were removed. (An asterisk used with any other operator is illegal.)
---

So it indeed is a string wildcard, without being version aware.
My reading of the above text is that "2*" will also match "20", "2_pre" and the like.

Maybe this could be mentioned in the manpage.

I propose:
---
 \fI*\fR means match any version of the package so long as the specified <string
 prefix> is matched.  So with a version of '2*', we can match '2.1', '2.2',
 '2.2.1', etc... and not match version '1.0', '3.0', '4.1', etc... The version
 part that comes before the '*' must be a valid version in the absence of the
 '*'. <Beware that, due to the string matching nature, also "20" will be matched
 by "2*".>
---
Comment 4 Zac Medico gentoo-dev 2010-08-23 06:33:55 UTC
This is in 2.2_rc68, but I'll leave this bug open until it's in an unmasked version.
Comment 5 Zac Medico gentoo-dev 2010-09-04 08:04:34 UTC
This is fixed in 2.1.9.