Bug#428897: New apt version?
Matt Kraai
kraai at ftbfs.org
Sat Jun 16 17:30:24 UTC 2007
tag 428897 patch
thanks
On Sat, Jun 16, 2007 at 09:30:23AM -0700, Daniel Burrows wrote:
> In theory, it could slow any program using apt down. The basic
> problem is that now, when you do Mark*(), apt runs an algorithm over
> the whole cache to find unused packages. This isn't too slow if it's
> done once, but if you modify more than one package in a row it starts
> to add up.
>
> The solution is to tell apt that you're going to perform a group of
> actions. You do this by creating a pkgDepCache::ActionGroup that wraps
> your actions; as long as it exists, apt will not update the unused
> states of packages.
Thanks for the explanation! I implemented your solution and it fixed
the problem. I've attached a patch.
--
Matt http://ftbfs.org/
-------------- next part --------------
diff -ru update-manager-0.42.2ubuntu22/UpdateManager/UpdateManager.py update-manager-0.42.2ubuntu22.new/UpdateManager/UpdateManager.py
--- update-manager-0.42.2ubuntu22/UpdateManager/UpdateManager.py 2006-05-24 08:14:21.000000000 -0700
+++ update-manager-0.42.2ubuntu22.new/UpdateManager/UpdateManager.py 2007-06-16 10:20:12.000000000 -0700
@@ -83,8 +83,10 @@
assert self._depcache.BrokenCount == 0 and self._depcache.DelCount == 0
self.all_changes = {}
def clean(self):
+ action_group = apt_pkg.GetPkgActionGroup(self._depcache)
for pkg in self:
pkg.markKeep()
+ action_group.release()
def saveDistUpgrade(self):
""" this functions mimics a upgrade but will never remove anything """
self._depcache.Upgrade(True)
More information about the pkg-gnome-maintainers
mailing list