You are not logged in.
Pages: 1
Topic closed
Is there a way to search just package names (not package descriptions) with yaourt or pacman? I'm imagining something like this:
$ yaourt -Ss --pkgname-only xterm
Thanks!
Last edited by partner55083777 (2010-02-03 16:30:43)
Offline
Fyi, using -Ss flags on Yaourt is known to not only be slow but very broken, and Yaourt will not return all or any results....or worse will return lots of search noise.
It will search for package name only...but you need to know the exact package name-i.e. "opera-devel" not just "opera"
Last edited by Skripka (2010-02-02 21:15:59)
Offline
My question still stands as to how I can search just package names. If it is using another program other than yaourt or pacman, that is okay.
"yaourt -Ss SEARCH_STRING" has been working as stated in the documentation for me (with yaourt-0.9.2.6). It will return all packages that have SEARCH_STRING in either the package name or package description.
Here are the first three results when running this command:
$ yaourt -Ss emacs
extra/emacs 23.1-3 [installed]
The Emacs Editor
extra/snd 10.1-1
Snd is the emacs of sound editor
extra/texmacs 1.0.7-3
GNU TeXmacs is a free scientific text editor, which was both inspired by TeX
and GNU Emacs. WYSIWYG editor TeX-fonts and CAS-interface (Giac, GTybalt,
Macaulay 2, Maxima, Octave, Pari, Qcl, R and Yacas) in one.
...
$
It looks like it works as specified in the man pages:
-s, --search <'regexp'>
This will search each package in the sync databases for names or descriptions that match regexp.
When you include multiple search terms, only packages with descriptions matching ALL of those terms will be returned.
Last edited by partner55083777 (2010-02-02 22:10:24)
Offline
if you know the full and exact name... like, say you wanted to see quickly if emacs was available in the repos.
pacman -Ss ^emac$
seems to always give you the desired exact match on package name (or nothing).
on the other hand, if you were trying to find all packages named "^haskell-.*" this does not seem to work. nor does it really obey the regex at all in my testing; i.e. ghc is matched which has only the word "Haskell" in the description which != ^haskell-.* IMO.
//github/
Offline
pacman -Sl | grep whatever
Offline
pacman -Sl | grep whatever
-Sl needs a repo as an argument.
so maybe, pacman -Sl core extra community | grep whatever
but maybe pacman -Ssq whatever | grep whatever would be faster; make it a bash function for ease of use.
edit:
and...
pacnames() { pacman -Ssq "$*" | grep "$*"; }
Last edited by brisbin33 (2010-02-03 00:26:45)
//github/
Offline
Profjim wrote:pacman -Sl | grep whatever
-Sl needs a repo as an argument.
pacman -Sl seems to work fine with no arguments and outputs all repos
Offline
pacman -Sl seems to work fine, albeit it is a bit slow. pacman -Ssq whatever | grep whatever also works well. Thanks!
But neither of these seem to work with yaourt and packages from AUR. yaourt -Sl doesn't list any packages from AUR, even when you explicitly give the AUR repository (yaourt -Sl aur).
yaourt -Ss -q whatever | grep whatever also doesn't work for packages from AUR. Their description is also output even with the -q flag. But if you modify it a little bit, you can grep out their description:
yaourt -Ss -q whatever | grep whatever | grep -v "^ "
That seems to work, and answers my original question, but I am a little surprised that this functionality is missing from the pacman and yaourt programs. This seems like something that other people would also be wanting.
If I submitted a patch for yaourt or pacman that implements this functionality, I wonder if it would be accepted?
Last edited by partner55083777 (2010-02-03 14:03:04)
Offline
You can do
yaourt -Ss --aur whatever | grep blah blah
Adding the -q switch to yaourt seems funky. For one thing, yaourt seems not to like "-Ssq", it needs "-Ss q". For another thing, when I do this (to yaourt-git, with some hacks of my own so maybe the fault is theirs):
yaourt -Ss -q pacman | grep namcap
I get back:
namcap/namcap ...
In other words, the repo is messed up.
I don't know how active yaourt development is going to be. The git repo stalled around Feb 2009, with a burst of 12 commits the following August,
then four small tweaks shortly afterwards. There are a couple of other community projects getting more attention. Paktahn and bauerbill have been especially active recently.
I'm still using yaourt myself, but will probably switch to another aur helper when I get a chance to review them.
Offline
OK. This thread is old, but the problem has remained.
Here is my solution:
search_in_AUR_byname:
#!/bin/bash
yaourt --color -Ss $1 | {
found=0
while IFS= read -r line; do
if egrep -qv "^.\[0m " <<< "$line"; then
if egrep -q $1 <<< "$line"; then
echo -e "$line"
found=1
else found=0
fi
elif [ $found -eq 1 ]; then echo -e "$line"
fi
done
}
P.S. Have a problem to post from ff because of Bad HTTP_REFERER issue.
Why it can't be ignored?
P.P.S. network.http.sendRefererHeader=2 and still doesn't work. bad site design.
Last edited by lefsha (2016-07-21 17:22:47)
Offline
Nice solution. And it falls under the exceptions of https://wiki.archlinux.org/index.php/Co … bumping.22
As you point out, however, this is an ancient thread, so I will use this opportunity to close it.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Pages: 1
Topic closed