From 4563ca1b77b6aa03d1708d84273938e49dd0c4de Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 9 Jul 2009 06:22:03 +0000 Subject: [PATCH] Fix for pisi up -c system.base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit : cdb Genel yardım için lütfen 'pisi help' komutunu kullanınız. Geri izleme verisi: File "/usr/bin/pisi", line 80, in cli.run_command() File "/usr/lib/pardus/pisi/cli/pisicli.py", line 140, in run_command self.command.run() File "/usr/lib/pardus/pisi/cli/upgrade.py", line 100, in run if self.componentdb.has_component(name): File "/usr/lib/pardus/pisi/db/componentdb.py", line 65, in has_component return self.cdb.has_item(name, repo) File "/usr/lib/pardus/pisi/db/lazydb.py", line 92, in __getattr__ raise AttributeError, attr --- pisi/cli/upgrade.py | 8 ++++---- pisi/db/lazydb.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pisi/cli/upgrade.py b/pisi/cli/upgrade.py index 8f049755..bb90d75c 100644 --- a/pisi/cli/upgrade.py +++ b/pisi/cli/upgrade.py @@ -45,7 +45,6 @@ expanded to package names. def __init__(self, args): super(Upgrade, self).__init__(args) - self.componentdb = pisi.db.componentdb.ComponentDB() name = ("upgrade", "up") @@ -96,12 +95,13 @@ expanded to package names. components = ctx.get_option('component') packages = [] if components: + componentdb = pisi.db.componentdb.ComponentDB() for name in components: - if self.componentdb.has_component(name): + if componentdb.has_component(name): if repository: - packages.extend(self.componentdb.get_packages(name, walk=True, repo=repository)) + packages.extend(componentdb.get_packages(name, walk=True, repo=repository)) else: - packages.extend(self.componentdb.get_union_packages(name, walk=True)) + packages.extend(componentdb.get_union_packages(name, walk=True)) packages.extend(self.args) packages = pisi.blacklist.exclude_from(packages, ctx.const.blacklist) diff --git a/pisi/db/lazydb.py b/pisi/db/lazydb.py index 16ecb074..8a546ee9 100644 --- a/pisi/db/lazydb.py +++ b/pisi/db/lazydb.py @@ -31,6 +31,7 @@ class Singleton(object): return self._the_instances[type(self).__name__] def _delete(self): + #FIXME: After invalidate, previously initialized db object becomes stale del self._the_instances[type(self).__name__] class LazyDB(Singleton):