Ok. lets kill this thirdpary stuff too. only enumeration in itembyrepodb is left, later it will be killed too

This commit is contained in:
Mehmet D. Akın
2007-03-19 11:38:30 +00:00
parent 48f44d67a8
commit c7047759a6
3 changed files with 9 additions and 29 deletions
-5
View File
@@ -155,11 +155,6 @@ class Install(AtomicOperation):
raise Error(_("%s package cannot be installed unless the dependencies are satisfied") % raise Error(_("%s package cannot be installed unless the dependencies are satisfied") %
self.pkginfo.name) 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 # check file conflicts
file_conflicts = [] file_conflicts = []
for file in self.files.list: for file in self.files.list:
+8 -21
View File
@@ -25,8 +25,8 @@ import pisi.db.lockeddbshelve as shelve
installed, thirdparty, repos, all = range(1, 5) installed, thirdparty, repos, all = range(1, 5)
"""installed and thirdparty are special databases to keep track """installed is a special database to keep track
of already installed stuff and third party stuff not in any real repository. of already installed stuff not in any real repository.
repos means search in repositories only, and all means search in repos means search in repositories only, and all means search in
repositories and special databases (called tracking databases) repositories and special databases (called tracking databases)
""" """
@@ -41,7 +41,6 @@ class ItemByRepoDB(object):
def __init__(self, name): def __init__(self, name):
self.d = shelve.LockedDBShelf(name) self.d = shelve.LockedDBShelf(name)
#self.dbyrepo = shelve.LockedDBShelf(name + '-byrepo')
def close(self): def close(self):
self.d.close() self.d.close()
@@ -58,18 +57,10 @@ class ItemByRepoDB(object):
@staticmethod @staticmethod
def not_just_tracking(data): def not_just_tracking(data):
keys = data.keys() keys = data.keys()
if len(keys)==1: for x in data.keys():
if 'trdparty' in keys or 'inst' in keys: if x.startsWith('repo-'):
return False return True
elif len(keys)==2: return False
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
def list_if(self, pred): def list_if(self, pred):
return [ k for k,data in self.d.items() if pred(k, data)] 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] assert repo in [all, repos]
order = [ 'repo-' + x for x in ctx.repodb.list() ] order = [ 'repo-' + x for x in ctx.repodb.list() ]
if repo == all: if repo == all:
order += ['trdparty', 'inst'] order += ['inst']
return order return order
# def list_repo(self, repo): # def list_repo(self, repo):
# return self.dbyrepo[repo] # return self.dbyrepo[repo]
def repo_str(self, repo): def repo_str(self, repo):
if repo==thirdparty: if repo==installed:
repo='trdparty'
elif repo==installed:
repo='inst' repo='inst'
else: else:
assert type(repo) == type("") assert type(repo) == type("")
@@ -111,8 +100,6 @@ class ItemByRepoDB(object):
def str_repo(self, str): def str_repo(self, str):
if str.startswith('repo-'): if str.startswith('repo-'):
return str[5:] return str[5:]
elif str=='trdparty':
return thirdparty
elif str=='inst': elif str=='inst':
return installed return installed
else: else:
+1 -3
View File
@@ -157,6 +157,4 @@ class PackageDB(object):
def remove_tracking_package(name, txn = None): def remove_tracking_package(name, txn = None):
# remove the guy from the tracking databases # remove the guy from the tracking databases
if pkgdb.has_package(name, itembyrepodb.installed, txn=txn): if pkgdb.has_package(name, itembyrepodb.installed, txn=txn):
pkgdb.remove_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)