I develop a GUI for Fink that attempts, among other things, to provide a 
one-screen view of all Fink packages, including their 
categories/sections. Historically the fink command-line tool has 
provided a flag to query the packages by a single category, e.g. fink 
list --section=foo, but no other hooks; "fink list" lacks this 
information. (This is in contrast to MacPorts, whose equivalent command 
to "fink list" does list categories.)

The result is that, to build a complete list of Fink packages that 
includes their categories, I must loop through each category in turn and 
append to the list that way, which is painfully slow. Here's the Python 
code that I use:

             self.getpackages = os.popen('%s list --section=%s' % 
(finkcmd, self.catname), 'r', os.O_NONBLOCK)
             for line in self.getpackages:
                 newline = line.split('\t')
                 rawcat = newline[0]
                 if rawcat == '(i)':
                     firstcat=rawcat.replace('(i)', 'outdated')
                 elif rawcat == ' i ':
                     firstcat=rawcat.replace('i', 'current')
                 elif rawcat == ' p ':
                     firstcat=rawcat.replace('p', 'provided')
                 else:
                     firstcat = rawcat
                 self.packagelist = (firstcat, newline[1], newline[2], 
self.catname, newline[3].strip('\n'))
                 self.masterlist.append(self.packagelist)


Because the Fink site is still apparently down, I am not able to check 
the developer documentation to see if there have been any changes or 
enhancements to the fink tool API. Is there any better way to get a 
complete list of packages and their categories in a single pass that I'm 
not aware of, perhaps using some Perl and calling Fink's API directly as 
a module?

Thanks,
Kevin

-- 
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to