Bug#428897: New apt version?

Matt Kraai kraai at ftbfs.org
Sat Jun 16 17:59:51 UTC 2007


On Sat, Jun 16, 2007 at 10:43:58AM -0700, Daniel Burrows wrote:
> On Sat, Jun 16, 2007 at 10:30:24AM -0700, Matt Kraai <kraai at ftbfs.org> was heard to say:
> > 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()
> 
>   I think you need try/finally here?

Ah, good point.  Does the attached patch look good?

-- 
Matt                                                 http://ftbfs.org/
-------------- next part --------------
diff -ru update-manager-0.42.2ubuntu22-old/UpdateManager/UpdateManager.py update-manager-0.42.2ubuntu22/UpdateManager/UpdateManager.py
--- update-manager-0.42.2ubuntu22-old/UpdateManager/UpdateManager.py	2006-05-24 08:14:21.000000000 -0700
+++ update-manager-0.42.2ubuntu22/UpdateManager/UpdateManager.py	2007-06-16 10:55:18.000000000 -0700
@@ -83,8 +83,12 @@
         assert self._depcache.BrokenCount == 0 and self._depcache.DelCount == 0
         self.all_changes = {}
     def clean(self):
-        for pkg in self:
-            pkg.markKeep()
+        action_group = apt_pkg.GetPkgActionGroup(self._depcache)
+        try:
+            for pkg in self:
+                pkg.markKeep()
+        finally:
+            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