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") %
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:
+8 -21
View File
@@ -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:
+1 -3
View File
@@ -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)