add generate_pending_list to api and use it in configure_pending and list_pending so we can see exact order with pisi lp

This commit is contained in:
S.Çağlar Onur
2006-12-06 15:20:49 +00:00
parent b08bca74b5
commit c85d563bd4
2 changed files with 11 additions and 6 deletions
+7 -3
View File
@@ -234,9 +234,7 @@ def generate_conflicts(A):
(C, D, E) = calculate_conflicts(A, ctx.packagedb) (C, D, E) = calculate_conflicts(A, ctx.packagedb)
return (C, D, E) return (C, D, E)
def configure_pending(): def generate_pending_list():
# start with pending packages
# configure them in reverse topological order of dependency
A = ctx.installdb.list_pending() A = ctx.installdb.list_pending()
G_f = pgraph.PGraph(ctx.packagedb, pisi.itembyrepodb.installed) # construct G_f G_f = pgraph.PGraph(ctx.packagedb, pisi.itembyrepodb.installed) # construct G_f
for x in A.keys(): for x in A.keys():
@@ -259,6 +257,12 @@ def configure_pending():
if ctx.componentdb.has_component('system.base'): if ctx.componentdb.has_component('system.base'):
order = reorder_base_packages(order) order = reorder_base_packages(order)
return order
def configure_pending():
# start with pending packages
# configure them in reverse topological order of dependency
order = generate_pending_list()
try: try:
import pisi.comariface as comariface import pisi.comariface as comariface
for x in order: for x in order:
+4 -3
View File
@@ -1472,9 +1472,10 @@ Lists packages waiting to be configured.
def run(self): def run(self):
self.init(database = True, write = False) self.init(database = True, write = False)
list = ctx.installdb.list_pending() order = api.generate_pending_list()
if len(list.keys()):
for p in list.keys(): if len(order):
for p in order:
print p print p
else: else:
ctx.ui.info(_('There are no packages waiting to be configured')) ctx.ui.info(_('There are no packages waiting to be configured'))