[pacman-dev] List packages from a given repo

Allan McRae mcrae_allan at hotmail.com
Fri May 9 22:33:06 EDT 2008

Dan McGee wrote:
> On Fri, May 9, 2008 at 8:29 PM, Allan McRae <mcrae_allan at hotmail.com> wrote:
>> Xavier wrote:
>>> and bask in the glory and speed of perl
>> Oooo, I am, I am!
> And while we are on the perl bus:
> http://code.toofishes.net/gitweb.cgi?p=pacman.git;a=commitdiff;h=555e2091725a255f2e7dbe10c7c17d0830a60e36
> Comments/questions/feedback would be much appreciated there. Perl
> isn't always obvious at first sight, so be sure to tell me if there
> are places that need more commenting.

Here we go:

+if ($#ARGV lt 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
+       print "$progname - List all packages installed from a given repo\n";
+       print "Usage:   $progname <pattern>\n";
+       print "Example: $progname ^gnome\n";

You will want to fix the description there...

Otherwise, I can follow what you are doing there and without 
understanding the specific details I don't see any obvious problems.

>> Now I preface this by saying I know next to nothing about perl....  but
>> from what I can tell, this script looks good.  Just one query, when
>> adding an item to a hash, does perl not return an indicator about
>> whether a new item was created or not?  If so, we can probably combine
> You might be right, but I think it is a bit clearer as is? I don't
> think we are going to get much of a performance gain over 0.1 seconds
> anyway. :)

Good point.  Leave it.

>> Otherwise, I'm happy to bung the copyright notice on the top and
>> recreate the patch.
> Did we decide on a name for this yet? Xavier called it repolist, you
> wanted to call it paclist and/or repopkg.

I vote for paclist because it lists packages, not repos and it fits with 
pacsearch and pacnew.

More information about the pacman-dev mailing list