On 01/23/14 at 02:58pm, Pierre Neidhardt wrote:
On 14-01-23 08:38:22, Andrew Gregory wrote:
On 01/23/14 at 12:07am, Pierre Neidhardt wrote:
No more per-repo coloring: this was not Arch-agnostic, and there is no reasonable, simple way to color repos in a consistant manner with only 6 colors.
'local' is in red: this way we benefit from the pacman -Ss && pacman -Qs combo.
to_color subroutine: it takes an array instead of a string, this is faster and simpler.
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> --- contrib/pacsearch.in | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-)
If we use pacman's color theme and remove per-repo coloring does this script still do anything worth keeping it around and fixing its bugs (try `pacsearch pacman mirrorlist`)? All that's left is searching both -Ss and -Qs, recoloring "local/" red, adding "[installed]" to -Qs entries, and hiding -Qs entries that are also in -Ss. All but the last can be accomplished in a few lines of bash using sed.
That was what I suggested in the first place a few days ago in my 'request for removal' mail. But Dan finds the combo of -Ss and -Qs quite useful and pointed quite good reasons to keep it.
I'm not disputing the usefulness of searching -Qs and -Ss at the same time, but that alone is a one line bash function. There's no point in keeping this script if that's all we care about.
This script is tiny, right, but not enough to be a one-liner (the "duplicate entry removal" needs a hash table and some parsing). Besides when you do it with sed/awk, you lose the coloring. And with sed/awk it's hard to sort without another call to 'sort', which does not save time. All these reasons are good enough to have this script.
pacsearch does not sort its results and you can still have color with sed/awk with --color=always.
If I understood you correctly, `pacsearch pacman mirrorlist` is not a bug. pacsearch's argument is a pattern, not package names. See pacsearch -h.
pacman mirrorlist is not the name of a package, those are two separate search terms that pacsearch needlessly combines into a single term when it passes them to pacman. apg