From 6bb47b1ab97c4eb01f72c8e157b25b30d0179c4b Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Wed, 6 Dec 2006 20:23:07 +0000 Subject: [PATCH] * keep generate_xyz_order api name consistency * give pending_list to generate_pending_order as the list to order. this avoids calling installdb.list_pending twice in configure_pending path. That call, reads the entire installdb and puts it on a dict var. so this also would decrease the memory usage. --- pisi/api.py | 5 ++--- pisi/cli/commands.py | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pisi/api.py b/pisi/api.py index ac8900fc..16466021 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -234,9 +234,8 @@ def generate_conflicts(A): (C, D, E) = calculate_conflicts(A, ctx.packagedb) return (C, D, E) -def generate_pending_list(): +def generate_pending_order(A): # returns pending package list in reverse topological order of dependency - A = ctx.installdb.list_pending() G_f = pgraph.PGraph(ctx.packagedb, pisi.itembyrepodb.installed) # construct G_f for x in A.keys(): G_f.add_package(x) @@ -264,7 +263,7 @@ def configure_pending(): # start with pending packages # configure them in reverse topological order of dependency A = ctx.installdb.list_pending() - order = generate_pending_list() + order = generate_pending_order(A) try: import pisi.comariface as comariface for x in order: diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 299bef93..adde1589 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -1472,7 +1472,8 @@ Lists packages waiting to be configured. def run(self): self.init(database = True, write = False) - order = api.generate_pending_list() + A = ctx.installdb.list_pending() + order = api.generate_pending_order(A) if len(order): for p in order: