[Dctrl-tools-devel] Bug#715024: Bug#715024: dctrl-tools: Surprising behaviour of -w -P

Antti-Juhani Kaijanaho antti-juhani at kaijanaho.fi
Wed Jul 17 06:58:41 UTC 2013


On Fri, Jul 05, 2013 at 05:06:03PM +0200, Christopher Huhn, GSI wrote:
> I just stumbled upon "grep-available -w -P libstdc++6" not finding any package. 
> 
> Obviously '+' signs are not treated as literals but regex operators and consequently
> "grep-available -w -P 'libstdc\+\+6'" properly locates the package.
> "grep-available -X -P libstdc++6" works as anticipated by me.
> 
> Is this the expected behaviour? 
> If so maybe the manpage should be a bit more verbose about the exact semantics 
> (and possible use) of -w.

The manpage says this about -w:

       -w, --whole-pkg
              Do  an extended regular expression match on whole package names,
              assuming the syntax of inter-package relationship fields such as
              Depends,Recommends,  ...  When this flag is given you should not
              worry about sub-package names such as "libpcre3"  also  matching
              "libpcre3-dev". This flag implies (and is incompatible with) -e.

The idea is, if I recall correctly, to allow you to see if a particular package
name (and not some other package name that happens to contain it as a
substring) occurs in a Depends field.  See #383921 for background.

Combining -w with -P isn't particularly useful, as the Package field does not
use Depends syntax.  You may want to use -PX instead.

However, I note the man page excerpt above says "an extended regular expression
match" and "This flag implies (and is incompatible with) -e" which to me pretty
clearly seems to say that the pattern must follow eregexp syntax.

Can you suggest a clearer wording?

-- 
Antti-Juhani Kaijanaho



More information about the Dctrl-tools-devel mailing list