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

Re: Writing an Apt frontend



On Thu, Mar 14, 2002 at 02:03:53PM +0000, Ross Burton <ross@burtonini.com> was heard to say:
> I am thinking about writing a simple GNOME2 program based upon a routine
> I do every few days:
> 
> 1. `dselect update`
> 2. run dselect and examine the list of new and updated packages
> 3. remember which ones I want to upgrade
> 4. in a console, `apt-get -qq --print-uris install [packagenames] >uris`
> 5. take that file to work (dialup at home, fast connection at work),
> transform the using awk into a ncftpget script and run
> 6. bring packages home on zip disk and drop into /var/cache/apt/archives
> 7. re-run `apt-get install [packagenames]
> 
> If I had a Wizard-like GUI over this I'd be very happy.  The question is
> how can I access the dpkg/apt database?  I can code in C and Perl, am
> learning C++ (but know Java so its just the syntax) and could learn
> Python -- so what bindings are available?

  You want to use libapt-pkg.  The way to figure its interface
out is: (in approximate order of usefulness)

  (a) read the header files.
  (b) look at other programs that use it.
  (c) read the source code.
  (d) read the documentation.

  There are Python bindings for it as well, but I don't think there's
any documentation for them at all -- see above, minus "header files"
(since it only comes as .sos; no .py component).  The only other program
I know of that uses it is "wajig".

  Daniel

-- 
/-------------------- Daniel Burrows <dburrows@debian.org> -------------------\
|                   Genius may have its limitations,                          |
|                   but stupidity is not thus handicapped.                    |
\------- (if (not (understand-this)) (go-to http://www.schemers.org)) --------/



Reply to: