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

Re: Auotmatic dependency handling for apt



On Wed, Dec 15, 2004 at 09:40:17PM +0200, Michael Hofmann wrote:
> Hi,
Hi,

> it would be nice to have automatic dependency handling in apt and
> synaptic.  I implemented a solution for testing in apt

First of all, thanks a lot for your patch.

It took a while, but I managed to review and merge your patch into a
experimental apt branch (apt--auto-mark--0) [1]. It seems to be
working ok, but I haven't put a lot of testing into it yet.

I changed the code so that it no longer use dpkg to store the
"Remove-Reason" information. It now generates a pkgstates file in the
spirit of aptitudes file in /var/lib/apt/pkgstates. 

The depcache is used for the DirtyState and AutomaticRemove fields, no
changes in the pkgCache::Package struct (Michael, do you see any
problems with this?).

The file is currently read in the pkgDepCache::Update() method and
written in apt-get.cc before the commit of the package actions
happens. I also made the "--experimental-automatic-remove" the default
action (for testing). 
 
I would like to ask for opinions on this pkgstates file. In the future
I would like to see a "New" field in it as well. The place to read it
in the source is probably not too well choosen. What might be a good
place?  The problem is that I don't want to put it into deb/ because
information like the automatic-remove reason or a possible future
"new" flag (or "unseen") is not deb specific. Jason, what do you think
about this (I would really love to hear your opinion)?

In the future I would like to add a "commit()" method to the depcache,
the automatic-remove reason could be stored in that method. I think
having commit() (and possibly update()) as methods in the depcache is
usefull (it takes quite a bit of code in synaptic, apt-get and in
pyhton-apt).


thanks,
 Michael

[1] michael.vogt@ubuntu.com--2005/apt--auto-mark--0 at
http://people.ubuntu.com/~mvo/arch/ubuntu

[..]
> apt needs to be patched for this to work :-). 
> 
> It introduces a couple of fields:
> - for the PackageCache: the current Automatic-Remove-state as read from
> the status file
> - for the DependencyCache: the new state of Automatic-Remove and a
> scratch field for the checking whether a package is unused
> 
> The state is set in the debian package manager right after the unpack.
> 
> The main work is for testing purposes done in apt-get.cc. There is
> basically a tree walker that marks all reachable packages and then
> selects the remaining ones for deinstallation.
> 
> If you feel brave, give it a try with --experimental-automatic-remove
> for apt-get. If you still have doubts, use -o Debug::pkgDPkgPM=true to
> only see the effects rather than experience them.
> 
> This works only for remove and install right now. It is by no means
> tested. It installs and deinstalls kdevelop and all the kde stuff
> correctly, but thats it. There is not defined update behaviour, so the
> Automatic-Remove state disappears. There may be a lot more glitches and
> problems, because a have no experience in messing with apt.
> 
> The implementation should be moved the one of the Cache classes when
> finshed I think.
> 
> A script is provided to transfer all automatic aptitude packages to dpkg
> --set-remove for testing.

-- 
Linux is not The Answer. Yes is the answer. Linux is The Question. - Neo



Reply to: