After updating apt-check to use the python-apt 0.7.93 API 
I hadn't renamed the new version to the production version
('/usr/lib/update-notifier/apt-check'), but as soon as I did,
the orange ball popped up in the notification area a few seconds 
later!

        I am attaching a patch to apt-check that updates 
apt-check to use the new API.
--- apt-check.dist	2010-03-18 17:55:06.000000000 -0400
+++ apt-check	2010-03-18 17:55:37.000000000 -0400
@@ -15,14 +15,14 @@
     # mvo: looping is too inefficient with the new auto-mark code
     #for pkg in cache.Packages:
     #    depcache.MarkKeep(pkg)
-    depcache.Init()
+    depcache.init()
 
 def saveDistUpgrade(cache,depcache):
     """ this functions mimics a upgrade but will never remove anything """
-    depcache.Upgrade(True)
-    if depcache.DelCount > 0:
+    depcache.upgrade(True)
+    if depcache.del_count > 0:
         clean(cache,depcache)
-    depcache.Upgrade()
+    depcache.upgrade()
 
 def _handleException(type, value, tb):
     sys.stderr.write("E: "+ "Unkown Error: '%s' (%s)" % (type,value))
@@ -59,22 +59,22 @@
 
 # get caches
 try:
-    cache = apt_pkg.GetCache()
+    cache = apt_pkg.Cache()
 except SystemError, e:
     sys.stderr.write("E: "+ _("Error: Opening the cache (%s)") % e)
     sys.exit(-1)
-depcache = apt_pkg.GetDepCache(cache)
+depcache = apt_pkg.DepCache(cache)
 
 # read the pin files
-depcache.ReadPinFile()
+depcache.read_pinfile()
 # read the synaptic pins too
 if os.path.exists(SYNAPTIC_PINFILE):
-    depcache.ReadPinFile(SYNAPTIC_PINFILE)
+    depcache.read_pinfile(SYNAPTIC_PINFILE)
 
 # init the depcache
-depcache.Init()
+depcache.init()
 
-if depcache.BrokenCount > 0:
+if depcache.broken_count > 0:
     sys.stderr.write("E: "+ _("Error: BrokenCount > 0"))
     sys.exit(-1)
 
@@ -89,21 +89,21 @@
 # because of ubuntu #7907
 upgrades = 0
 security_updates = 0
-for pkg in cache.Packages:
-    if depcache.MarkedInstall(pkg) or depcache.MarkedUpgrade(pkg):
+for pkg in cache.packages:
+    if depcache.marked_install(pkg) or depcache.marked_upgrade(pkg):
         # check if this is really a upgrade or a false positive
         # (workaround for ubuntu #7907)
-	if depcache.GetCandidateVer(pkg) != pkg.CurrentVer:
+	if depcache.get_candidate_ver(pkg) != pkg.current_ver:
 		upgrades = upgrades + 1	
-                ver = depcache.GetCandidateVer(pkg)
-                for (file, index) in ver.FileList:
-                    if (file.Archive.endswith("-security") and
+                ver = depcache.get_candidate_ver(pkg)
+                for (file, index) in ver.file_list:
+                    if (file.archive.endswith("-security") and
                         file.Origin == "Ubuntu"):
                         security_updates += 1
 
 # print the number of upgrades
 if options.show_package_names:
-    pkgs = filter(lambda pkg: depcache.MarkedInstall(pkg) or depcache.MarkedUpgrade(pkg), cache.Packages)
+    pkgs = filter(lambda pkg: depcache.marked_install(pkg) or depcache.marked_upgrade(pkg), cache.packages)
     sys.stderr.write("\n".join(map(lambda p: p.Name, pkgs)))
 else:
     # print the number of regular upgrades and the number of 

Reply via email to