[pacman-dev] [PATCH 2/6] pacsearch: support for multiple search patterns like in pacman search
Andrew Gregory
andrew.gregory.8 at gmail.com
Mon Feb 3 11:06:03 EST 2014
On 02/03/14 at 02:23pm, Pierre Neidhardt wrote:
> On 14-02-03 07:36:32, Andrew Gregory wrote:
> > On 02/03/14 at 12:36pm, Pierre Neidhardt wrote:
> > > Previously the different positional arguments formed a single pattern containing
> > > spaces. Now each argument is a different pattern to match.
> > >
> > > Signed-off-by: Pierre Neidhardt <ambrevar at gmail.com>
> > > ---
> > > contrib/pacsearch.in | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > See commit 380f062be. This breaks patterns like 'foo|bar'
>
> Right. Any idea how to solve this dilemma?
Yes, don't run pacman in a shell, use open.
> > > diff --git a/contrib/pacsearch.in b/contrib/pacsearch.in
> > > index 71e0107..8e05a1a 100644
> > > --- a/contrib/pacsearch.in
> > > +++ b/contrib/pacsearch.in
> > > @@ -100,7 +100,7 @@ sub to_color {
> > >
> > > my %allpkgs = ();
> > >
> > > -my $syncout = `pacman -Ss '@ARGV'`;
> > > +my $syncout = `pacman -Ss @ARGV`;
> > > # split each sync search entry into its own array entry
> > > my @syncpkgs = split(/\n^(?=\w)/m, $syncout);
> > > # remove the extra \n from the last desc entry
> > > @@ -127,7 +127,7 @@ foreach $_ (@syncpkgs) {
> > > $allpkgs{$pkgfields[1]} = [ @pkgfields ];
> > > }
> > >
> > > -my $queryout = `pacman -Qs '@ARGV'`;
> > > +my $queryout = `pacman -Qs @ARGV`;
> > > # split each querysearch entry into its own array entry
> > > my @querypkgs = split(/\n^(?=\w)/m, $queryout);
> > > # remove the extra \n from the last desc entry
> > > --
> > > 1.8.5.3
> >
>
> --
> Pierre Neidhardt
>
> "A raccoon tangled with a 23,000 volt line today. The results blacked
> out 1400 homes and, of course, one raccoon."
> -- Steel City News
>
More information about the pacman-dev
mailing list