[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#618776: searching for hold will match packages with that name



On Sun, Mar 20, 2011 at 12:19:55PM +0100, Javier Fernández-Sanguino Peña wrote:
> On Fri, Mar 18, 2011 at 12:23:42PM +0000, Owen Dunn wrote:
> > Package: release-notes
> > 
> > Chapter 4 of the squeeze release notes asks one to search for holds
> > by typing:
> > 
> > dpkg --get-selections | grep hold
> > 
> > This will erroneously match any packages whose names contain the
> > string `hold'
> 
> Probably the following would be a better alternative:
> 
> dpkg --get-selections |egrep '\shold$' 

If we go this far, 
  dpkg --get-selections |grep -E '\shold$'

Manpage of grep(1) states use of egrep deprecated:

| In  addition,  three  variant  programs  egrep,  fgrep  and  rgrep  are
| available.   egrep  is  the  same  as  grep -E.   fgrep  is the same as
| grep -F.  rgrep is the same as grep -r.  Direct  invocation  as  either
| egrep  or  fgrep  is  deprecated,  but  is provided to allow historical
| applications that rely on them to run unmodified.

I think this egrep match is excessive complication for simple thing 
since "PACKAGE SELECTION STATES" are only:
 install
 hold
 deinstall
 purge

So use of \s is not required.

Regards,

Osamu



Reply to: