[entropy.client] Client.open_repository() make possible to get installed packages repo

This commit is contained in:
Fabio Erculiani
2010-02-02 16:50:43 +01:00
parent dfa7b75d4f
commit 4d3a5be4bc
2 changed files with 13 additions and 2 deletions
@@ -152,16 +152,23 @@ class RepositoryMixin:
def open_repository(self, repoid):
# support for installed pkgs repository, got by issuing
# repoid = etpConst['clientdbid']
if repoid == etpConst['clientdbid']:
return self._installed_repository
key = self.__get_repository_cache_key(repoid)
if key not in self._repodb_cache:
dbconn = self.load_repository_database(repoid, xcache = self.xcache,
indexing = self.indexing)
dbconn = self.load_repository_database(repoid,
xcache = self.xcache, indexing = self.indexing)
try:
dbconn.checkDatabaseApi()
except (OperationalError, TypeError,):
pass
self._repodb_cache[key] = dbconn
return dbconn
return self._repodb_cache.get(key)
def load_repository_database(self, repoid, xcache = True, indexing = True):
+4
View File
@@ -1187,6 +1187,10 @@ class SystemSettings(Singleton, EntropyPluginStore):
reponame, repodata = self._analyze_client_repo_string(line,
data['branch'], data['product'])
if reponame == etpConst['clientdbid']:
# not allowed!!!
continue
repoids.add(reponame)
if reponame in my_repodata: