From c85d563bd4639671d2f46d9e9f7499f23cb8f2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Wed, 6 Dec 2006 15:20:49 +0000 Subject: [PATCH] add generate_pending_list to api and use it in configure_pending and list_pending so we can see exact order with pisi lp --- pisi/api.py | 10 +++++++--- pisi/cli/commands.py | 7 ++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pisi/api.py b/pisi/api.py index 26b21e24..6c287f36 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -234,9 +234,7 @@ def generate_conflicts(A): (C, D, E) = calculate_conflicts(A, ctx.packagedb) return (C, D, E) -def configure_pending(): - # start with pending packages - # configure them in reverse topological order of dependency +def generate_pending_list(): A = ctx.installdb.list_pending() G_f = pgraph.PGraph(ctx.packagedb, pisi.itembyrepodb.installed) # construct G_f for x in A.keys(): @@ -259,6 +257,12 @@ def configure_pending(): if ctx.componentdb.has_component('system.base'): 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: import pisi.comariface as comariface for x in order: diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 0ca76dec..299bef93 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -1472,9 +1472,10 @@ Lists packages waiting to be configured. def run(self): self.init(database = True, write = False) - list = ctx.installdb.list_pending() - if len(list.keys()): - for p in list.keys(): + order = api.generate_pending_list() + + if len(order): + for p in order: print p else: ctx.ui.info(_('There are no packages waiting to be configured'))