[Uludag-commits] r15255 - in branches/pisi-db/pisi: . operations

uludag-commits at pardus.org.tr uludag-commits at pardus.org.tr
1 Eyl 2007 Cmt 22:32:35 EEST


Author: faik
Date: Sat Sep  1 22:32:35 2007
New Revision: 15255

Modified:
   branches/pisi-db/pisi/api.py
   branches/pisi-db/pisi/operations/upgrade.py
Log:
fix is_upgradable and comment - temporarly - replaces part of list_upgradables

Also havent figured out yet how to find the right repo... in which order...
the current db code does need a repo other than the previous code that can take
None as a repo parameter... So which_repo may be used for sometime


Modified: branches/pisi-db/pisi/api.py
=================================================================
--- branches/pisi-db/pisi/api.py	(original)
+++ branches/pisi-db/pisi/api.py	Sat Sep  1 22:32:35 2007
@@ -157,7 +157,7 @@
     return set(ctx.packagedb.list_packages(repo = repo))
 
 def list_upgradable():
-    return filter(pisi.operations.helper.is_upgradable, ctx.installdb.list_installed()) + ctx.packagedb.get_replaces().keys()
+    return filter(pisi.operations.upgrade.is_upgradable, ctx.installdb.list_installed()) # FIX:DB ctx.packagedb.get_replaces().keys()
 
 def package_graph(A, repo = pisi.db.installed, ignore_installed = False):
     """Construct a package relations graph.

Modified: branches/pisi-db/pisi/operations/upgrade.py
=================================================================
--- branches/pisi-db/pisi/operations/upgrade.py	(original)
+++ branches/pisi-db/pisi/operations/upgrade.py	Sat Sep  1 22:32:35 2007
@@ -233,14 +233,16 @@
 def is_upgradable(name, ignore_build = False):
     if not ctx.installdb.has_package(name):
         return False
-    (version, release, build) = ctx.installdb.get_version(name)
+
+    info = ctx.installdb.get_info(name)
+    (version, release, build) = (info.version, info.release, info.build)
     try:
-        pkg = ctx.packagedb.get_package(name)
+        pkg = ctx.packagedb.get_package(name, ctx.packagedb.which_repo(name))
     except KeyboardInterrupt:
         raise
     except Exception: #FIXME: what exception could we catch here, replace with that.
         return False
-        
+
     if ignore_build or (not build) or (not pkg.build):
         return pisi.version.Version(release) < pisi.version.Version(pkg.release)
     else:


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi