You are not logged in.

#1 2010-02-27 07:39:22

netawater
Member
Registered: 2008-08-01
Posts: 36

[SOLVED]How to search package name only when using yaourt

I often install a AUR package by yaourt term, but it does not only search terms in package name but also package description, since there are so much packages in AUR, it produce many pages of items, and it can not support more to page one screenful at a time, It
become difficult to get the right choice, sad

Thank you in advance!

Last edited by netawater (2013-06-14 00:47:06)

Offline

#2 2010-02-27 08:30:01

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: [SOLVED]How to search package name only when using yaourt

Hey, that's one thing I actually know how to do with regexes! All package descriptions have some spaces at their beginning, the package names themselves have not, so you can just use inverted grepping like so:

$ pacman -Ss test | grep -v '^    '
core/perl 5.10.1-5 (base)
extra/fprint_demo 0.4-2 (fprint)
extra/ghc 6.12.1-2
extra/haskell-hunit 1.2.2.1-1
extra/haskell-quickcheck 2.1.0.3-1
extra/junit 4.7-1
extra/kdesdk-kpartloader 4.4.0-1 (kde kdesdk)
extra/libxtst 1.1.0-1
extra/memtest86+ 4.00-1
extra/mono-tools 2.6.1-1
extra/openoffice-base 3.2.0-1
extra/openoffice-base-beta 3.2.0_ooo320_m12-1
extra/perl-test-pod 1.41-1
extra/python-nose 0.11.1-1
extra/qemu-kvm 0.12.2-1
extra/testdisk 6.11.3-2
extra/unarj 2.63a-2
extra/xbill 2.1-6
xyne-any/reflector 5.0-2
community/buildbot 0.7.11p3-1
community/cppunit 1.12.1-1
community/cxxtest 3.10.1-3
community/dsniff 2.4b1-15
community/gtk-aurora-engine 1.5.1-1
community/gtkperf 0.40-3
community/java-jdom 1.1.1-1
community/lib32-libxtst 1.1.0-1 (lib32)
community/perl-test-base 0.59-1
community/perl-test-deep 0.106-1
community/perl-test-differences 0.500-1
community/perl-test-exception 0.29-1
community/perl-test-manifest 1.23-1
community/perl-test-mockobject 1.09-1
community/perl-test-nowarnings 1.01-1
community/perl-test-tester 0.107-1
community/perl-test-warn 0.21-2
community/phoronix-test-suite 2.4.0-1
community/pmtools 20100123-1
community/reflector 5.0-2
community/stress 1.0.0-2
community/typespeed 0.6.5-2
arch-games/mangler-snapshot 1.1.20100116-3
arch-games/ultimatestunts 0.7.5.1-1

This still shows the repos and the versions (nothing cut wouldn't be able to handle though). It works fine with pacman as you just saw, I can't guarantee for yaourt as I don't have it installed.

Edit: Hm… I just realized that this still displays the results where 'test' only occured in the package description. sad Give me some time to figure this out. tongue

Edit 2: Another grep for 'test' would solve it:

$ pacman -Ss test | grep -v '^   ' | grep test
extra/memtest86+ 4.00-1
extra/perl-test-pod 1.41-1
extra/testdisk 6.11.3-2
community/cxxtest 3.10.1-3
community/perl-test-base 0.59-1
community/perl-test-deep 0.106-1
community/perl-test-differences 0.500-1
community/perl-test-exception 0.29-1
community/perl-test-manifest 1.23-1
community/perl-test-mockobject 1.09-1
community/perl-test-nowarnings 1.01-1
community/perl-test-tester 0.107-1
community/perl-test-warn 0.21-2
community/phoronix-test-suite 2.4.0-1
arch-games/ultimatestunts 0.7.5.1-1

Still, it's not that pretty to write the same thing twice. If you really want to do it like this, I suggest you make it a function in your ~/.${SHELL}rc.

Last edited by Runiq (2010-02-27 08:36:11)

Offline

#3 2010-03-01 00:53:36

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: [SOLVED]How to search package name only when using yaourt

Thanks very much! smile

Offline

Board footer

Powered by FluxBB