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

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



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.

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 ).

>From my understanding of the apt code this is the easiest way to attain
this goal... and it's also a lot of work that I prefer to do in python
the to ack the c++ code base of apt-get.

> > Provided a bit of guidance (I'm not very familiar with the apt python
> > bindings), we'll be happy to provide a patch.
> I'm going to write it next week, the 0.8.0~exp4 release next
> Tuesday/Wednesday would then include it.

thank you ! this is fantastic !

regards.
pietro

-- 
----
http://en.wikipedia.org/wiki/Posting_style



Reply to: