[pacman-dev] List packages from a given repo

Xavier shiningxc at gmail.com
Sat May 10 08:09:00 EDT 2008


Dan McGee wrote:
> 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.
>

Looks fine to me.
But doing a step back over pacsearch / paclist, it seems like the task 
of adding an install marker (***) would be much easier to do in pacman 
itself. Then paclist would be a one liner :
pacman -Sl community | grep "^*"
And pacsearch should be much simpler as well, it would just have to 
worry about colors. And keeping all that color stuff in an external 
script seems reasonable to me.

So the main advantage of doing it directly in pacman would be an overall 
code reduction / simplification. But the downside is an useless loss of 
performance for people who don't need that feature.
-Sl before the patch is 0.085ms and after it is 0.225ms.
I believe that pacman lookups are not very efficient since they do a 
basic linear search. But I don't know how much we could gain here, for 
example by using a binary search over a sorted list, or using a hash 
table for the pkgcache.
Otherwise, this feature of marking installed packages could be disabled 
by default and enabled with a flag.

> 
>> 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 am fine with paclist, so I just changed the name and added the 
copyright notice, I can then put it on my git repo .
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: add_install_marker_to_Ss_and_Sl.diff
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20080510/ed56154a/attachment.diff>


More information about the pacman-dev mailing list