[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: interpreting Status field in dpkg status/available file



On Tue, Feb 27, 2001 at 11:17:38PM +1100, Craig Sanders wrote:
> > Why?  Can't you just take the output of
> > COLUMNS=1000 dpkg -l \*
> > and let dpkg do the work?  It doesn't chop off any package names.
> 
> i could do that but i don't want to. that's basically what i did in the
> last version.
> 
> a big part of the point of dlocate is speed. it's a LOT faster to run
> grep-dctrl or just 'cat /var/lib/dpkg/status' and parse the output than
> it is to run "dpkg -l".

But if you only do it once per cron job, it doesn't really matter.

> dpkg's output hasn't changed much for ages (except for a bug a few
> versions ago where it acted differently when called from a cron job
> without a tty), but i just don't like making hard-coded assumptions
> about textual output.

Yes, I know about that bug; I provided the patch for it ;-)

> by parsing the status file i know precisely what i am going to get
> as input and not have to worry about spacing of fields or number of
> "words" in a field - there are no field names or field delimiters in
> dpkg's output.  not serious problems, but aesthetically unpleasing.

Fair enough.

> also, i want to know how to do it - and submit the result as a
> subroutine for dpkg-perl (if it's still being maintained) and/or
> grep-dctrl.

Cool!

   Julian

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

         Julian Gilbey, Dept of Maths, Queen Mary, Univ. of London
       Debian GNU/Linux Developer,  see http://people.debian.org/~jdg
  Donate free food to the world's hungry: see http://www.thehungersite.com/



Reply to: