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

Bug#623485: python-apt: please add bindings pkgOrderList



On Do, 2011-04-21 at 16:57 +0200, Pietro Abate wrote:
> hello
> 
> On Thu, Apr 21, 2011 at 03:53:39PM +0200, Julian Andres Klode wrote:
> > On Mi, 2011-04-20 at 19:06 +0200, Pietro Abate wrote:
> > > This is a request to add a new binding to the class pkgOrderList of apt.
> > > The idea is to allow to compute and set the pkgOrderList independently
> > > and reason about it.
> > > 
> > > At the moment the only way to compute (via apt-get) the installation
> > > plan is to execute it and print a debug trace of it. 
> > > 
> > > For the mancoosi project we would like to compute the plan before
> > > executing it and to simulate the installation in order to detect
> > > possible problems in the installation scripts.
> > > 
> > > I'm aware that this binding will export a read-only object and that the
> > > installation plan will be recomputed by apt-get. This will be sufficient
> > > for our goals.
> > As far as I can tell, the object would be read-write. You fill the list,
> > then you order it, and then you read it again. So, shall I bind just the
> > pkgOrderList class or do you want anything related as well?
> 
> If I read the code correctly, you initialize the pkgOrderList with the
> cache (that contains the packages marked to be installed/removed) and
> then you read back the list of ordered packages. In this sense the
> object is of course read/write.
You could also add some packages, order, add some more.

> 
> My remark was related how the pkgOrderList class is used in the module
> packageManager where the orderedlist is protected. Without modifying
> the API of the packageManager it is not possible at the moment to pass
> to the installer the installation plan. This is also because the
> computation of the installation plan is intertwined with the
> real installation itself (for performances reasons I presume).
> 
> What we need is a way to build the installation plan from the cache
> (initialized with the packages that are going to be installed/removed).
> There are a bunch of protected functions in packageManager that use the
> orderedList, but as far as I can see they are all protected... 
> 
> Once the pkgOrderList class will be available I think I'll need to
> reimplement in my application the logic of few functions in
> packageManager to (re)-build the installation plan (aka the order in
> which dpkg is called to pre-configure / unpack / configure / install /
> remove / *-hooks / ext ).

But OrderList being available in the Python bindings only brings you the
ordering itself, no integration whatsoever with PackageManager. All the
interesting stuff in PackageManager is protected and thus not bound.

And binding OrderList is not fun, it's severely under-documented. That's
a pain to bind: Because the bindings are fully documented, I need to
play detective and find out what functions and values are supposed to
mean...

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.





Reply to: