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

uludag-commits at pardus.org.tr uludag-commits at pardus.org.tr
1 Eki 2007 Pzt 12:00:50 EEST


Author: faik
Date: Mon Oct  1 12:00:50 2007
New Revision: 15573

Modified:
   branches/pisi-db/pisi/api.py
   branches/pisi-db/pisi/cli/graph.py
   branches/pisi-db/pisi/operations/install.py
   branches/pisi-db/pisi/operations/remove.py
   branches/pisi-db/pisi/operations/upgrade.py
   branches/pisi-db/pisi/pgraph.py
Log:
PGraph should take packagedb as before


Modified: branches/pisi-db/pisi/api.py
=================================================================
--- branches/pisi-db/pisi/api.py	(original)
+++ branches/pisi-db/pisi/api.py	Mon Oct  1 12:00:50 2007
@@ -159,7 +159,7 @@
 def list_upgradable():
     return filter(pisi.operations.upgrade.is_upgradable, ctx.installdb.list_installed()) # FIX:DB ctx.packagedb.get_replaces().keys()
 
-def package_graph(A, useinstalldb = False, ignore_installed = False):
+def package_graph(A, packagedb, ignore_installed = False):
     """Construct a package relations graph.
     
     Graph will contain all dependencies of packages A, if ignore_installed
@@ -172,7 +172,7 @@
     # try to construct a pisi graph of packages to
     # install / reinstall
 
-    G_f = pgraph.PGraph(useinstalldb)             # construct G_f
+    G_f = pgraph.PGraph(packagedb)             # construct G_f
 
     # find the "install closure" graph of G_f by package 
     # set A using packagedb
@@ -232,7 +232,7 @@
 
 def generate_pending_order(A):
     # returns pending package list in reverse topological order of dependency
-    G_f = pgraph.PGraph(useinstalldb=True) # construct G_f
+    G_f = pgraph.PGraph(ctx.installdb) # construct G_f
     for x in A:
         G_f.add_package(x)
     B = A

Modified: branches/pisi-db/pisi/cli/graph.py
=================================================================
--- branches/pisi-db/pisi/cli/graph.py	(original)
+++ branches/pisi-db/pisi/cli/graph.py	Mon Oct  1 12:00:50 2007
@@ -65,7 +65,7 @@
                 repo = ctx.get_option('repository')
                 ctx.ui.info(_('Plotting packages in repository %s') % repo)
             else:
-                useinstalldb = False
+                packagedb = ctx.packagedb
             if self.args:
                 a = self.args
             else:
@@ -78,8 +78,8 @@
                 # if A is empty, then graph all packages
                 ctx.ui.info(_('Plotting a graph of relations among all installed packages'))
                 a = ctx.installdb.list_installed()
-            useinstalldb = True
-        g = pisi.api.package_graph(a, useinstalldb,
+            packagedb = ctx.installdb
+        g = pisi.api.package_graph(a, packagedb,
                                    ignore_installed = ctx.get_option('ignore_installed'))
         g.write_graphviz(file(ctx.get_option('output'), 'w'))
         self.finalize()

Modified: branches/pisi-db/pisi/operations/install.py
=================================================================
--- branches/pisi-db/pisi/operations/install.py	(original)
+++ branches/pisi-db/pisi/operations/install.py	Mon Oct  1 12:00:50 2007
@@ -162,7 +162,7 @@
     # try to construct a pisi graph of packages to
     # install / reinstall
 
-    G_f = pgraph.PGraph(useinstalldb=False)               # construct G_f
+    G_f = pgraph.PGraph(ctx.packagedb)               # construct G_f
 
     # find the "install closure" graph of G_f by package
     # set A using packagedb
@@ -201,7 +201,7 @@
     # try to construct a pisi graph of packages to
     # install / reinstall
 
-    G_f = pgraph.PGraph(useinstalldb=False)               # construct G_f
+    G_f = pgraph.PGraph(ctx.packagedb)               # construct G_f
 
     # find the "install closure" graph of G_f by package
     # set A using packagedb

Modified: branches/pisi-db/pisi/operations/remove.py
=================================================================
--- branches/pisi-db/pisi/operations/remove.py	(original)
+++ branches/pisi-db/pisi/operations/remove.py	Mon Oct  1 12:00:50 2007
@@ -84,7 +84,7 @@
     # try to construct a pisi graph of packages to
     # install / reinstall
 
-    G_f = pgraph.PGraph(useinstalldb=True)               # construct G_f
+    G_f = pgraph.PGraph(ctx.installdb)               # construct G_f
 
     # find the (install closure) graph of G_f by package
     # set A using packagedb

Modified: branches/pisi-db/pisi/operations/upgrade.py
=================================================================
--- branches/pisi-db/pisi/operations/upgrade.py	(original)
+++ branches/pisi-db/pisi/operations/upgrade.py	Mon Oct  1 12:00:50 2007
@@ -155,7 +155,7 @@
 
     packagedb = ctx.packagedb
 
-    G_f = pgraph.PGraph(useinstalldb=False)               # construct G_f
+    G_f = pgraph.PGraph(ctx.packagedb)               # construct G_f
 
     # find the "install closure" graph of G_f by package
     # set A using packagedb

Modified: branches/pisi-db/pisi/pgraph.py
=================================================================
--- branches/pisi-db/pisi/pgraph.py	(original)
+++ branches/pisi-db/pisi/pgraph.py	Mon Oct  1 12:00:50 2007
@@ -23,12 +23,9 @@
 
 class PGraph(graph.Digraph):
 
-    def __init__(self, useinstalldb=False):
+    def __init__(self, packagedb):
         super(PGraph, self).__init__()
-        if useinstalldb:
-            self.packagedb = ctx.installdb
-        else:
-            self.packagedb = ctx.packagedb
+        self.packagedb = packagedb
 
     def add_package(self, pkg):
         pkg1 = self.packagedb.get_package(pkg)


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi