[pacman-dev] List packages from a given repo

Allan McRae mcrae_allan at hotmail.com
Thu May 8 20:07:30 EDT 2008


Dan McGee wrote:
> [snip]
>> # TODO: Could match version numbers to catch packages
>> #       install with pacman -S repo/pkg
>>     
> Did you take a look at my pacsearch script? That does some sort of
> intelligent matching of package versions.
>
>   
I like the description "some sort of intelligent matching"...  Sounds 
convincing!
>> readonly progname="repopkg"
>> readonly version="1.0"
>>
>> if [ -z "$1" -o "$1" = "--help" -o "$1" = "-h" ]; then
>>        echo "Usage: $progname <repo>"
>>        echo "Ex:    $progname testing"
>>     
> Just spell out "Example"? We can afford a few more bytes. :)
>
>   
I was copying your pacsearch script!
> [snip]
>> for pkg in $(pacman -Qq); do
>>  match=$(grep -m1 " $pkg " $pkglist | grep "^$1")
>>     
> Not exactly cheap as you have to do two grep calls for every package
> you list. Perhaps cmp or diff could be used?
>
> And now for the real off-the-wall suggestion- doing this in perl would
> give you the power of regular expressions and probably make this all
> real easy. That is if you can figure out perl.
>
>   

The saying that "perl is like an explosion in an ascii factory" pretty 
much describes how I see perl...  If/when I add the pkgver matching then 
this will disappear.

Also, I think I will rename the script "paclist" as that is perhaps 
slightly better that "repopkg".  It also has the "pac" prefix which 
matches pacsearch and pacdiff.

Allan







More information about the pacman-dev mailing list