From c7047759a62c31580127bea29a7dc885456f5376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20D=2E=20Ak=C4=B1n?= Date: Mon, 19 Mar 2007 11:38:30 +0000 Subject: [PATCH] Ok. lets kill this thirdpary stuff too. only enumeration in itembyrepodb is left, later it will be killed too --- pisi/atomicoperations.py | 5 ----- pisi/db/itembyrepodb.py | 29 ++++++++--------------------- pisi/db/packagedb.py | 4 +--- 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 579e2130..de392eba 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -155,11 +155,6 @@ class Install(AtomicOperation): raise Error(_("%s package cannot be installed unless the dependencies are satisfied") % self.pkginfo.name) - # check if package is in database - # If it is not, put it into 3rd party packagedb - if not ctx.packagedb.has_package(self.pkginfo.name): - ctx.packagedb.add_package(self.pkginfo, pisi.db.itembyrepodb.thirdparty) - # check file conflicts file_conflicts = [] for file in self.files.list: diff --git a/pisi/db/itembyrepodb.py b/pisi/db/itembyrepodb.py index 84d12195..a3c4dbe5 100644 --- a/pisi/db/itembyrepodb.py +++ b/pisi/db/itembyrepodb.py @@ -25,8 +25,8 @@ import pisi.db.lockeddbshelve as shelve installed, thirdparty, repos, all = range(1, 5) -"""installed and thirdparty are special databases to keep track -of already installed stuff and third party stuff not in any real repository. +"""installed is a special database to keep track +of already installed stuff not in any real repository. repos means search in repositories only, and all means search in repositories and special databases (called tracking databases) """ @@ -41,7 +41,6 @@ class ItemByRepoDB(object): def __init__(self, name): self.d = shelve.LockedDBShelf(name) - #self.dbyrepo = shelve.LockedDBShelf(name + '-byrepo') def close(self): self.d.close() @@ -58,18 +57,10 @@ class ItemByRepoDB(object): @staticmethod def not_just_tracking(data): keys = data.keys() - if len(keys)==1: - if 'trdparty' in keys or 'inst' in keys: - return False - elif len(keys)==2: - if 'trdparty' in keys and 'inst' in keys: - return False - return True - #below is a slower way - #for x in data.keys(): - # if x.startsWith('repo-'): - # return True - #return False + for x in data.keys(): + if x.startsWith('repo-'): + return True + return False def list_if(self, pred): return [ k for k,data in self.d.items() if pred(k, data)] @@ -92,16 +83,14 @@ class ItemByRepoDB(object): assert repo in [all, repos] order = [ 'repo-' + x for x in ctx.repodb.list() ] if repo == all: - order += ['trdparty', 'inst'] + order += ['inst'] return order # def list_repo(self, repo): # return self.dbyrepo[repo] def repo_str(self, repo): - if repo==thirdparty: - repo='trdparty' - elif repo==installed: + if repo==installed: repo='inst' else: assert type(repo) == type("") @@ -111,8 +100,6 @@ class ItemByRepoDB(object): def str_repo(self, str): if str.startswith('repo-'): return str[5:] - elif str=='trdparty': - return thirdparty elif str=='inst': return installed else: diff --git a/pisi/db/packagedb.py b/pisi/db/packagedb.py index f4f952d9..3fd3f719 100644 --- a/pisi/db/packagedb.py +++ b/pisi/db/packagedb.py @@ -157,6 +157,4 @@ class PackageDB(object): def remove_tracking_package(name, txn = None): # remove the guy from the tracking databases if pkgdb.has_package(name, itembyrepodb.installed, txn=txn): - pkgdb.remove_package(name, itembyrepodb.installed, txn=txn) - if pkgdb.has_package(name, itembyrepodb.thirdparty, txn=txn): - pkgdb.remove_package(name, itembyrepodb.thirdparty, txn=txn) + pkgdb.remove_package(name, itembyrepodb.installed, txn=txn) \ No newline at end of file