* trying to solve a silly bug with db init
This commit is contained in:
+3
-2
@@ -65,8 +65,9 @@ def init(database = True, options = None, ui = None, comar = True):
|
||||
ctx.installdb = pisi.installdb.init()
|
||||
ctx.filesdb = pisi.files.FilesDB()
|
||||
|
||||
# TODO: bunun da ctx'de olmasi gerek, global hesabi
|
||||
packagedb.init()
|
||||
packagedb.init_db()
|
||||
|
||||
#TODO: sourcedb
|
||||
# import pisi.sourcedb
|
||||
# pisi.sourcedb.init()
|
||||
|
||||
|
||||
@@ -656,6 +656,7 @@ Remove all repository information from the system.
|
||||
self.init()
|
||||
for repo in self.args:
|
||||
pisi.api.remove_repo(repo)
|
||||
ctx.ui.info(_('Repo %s removed from system.') % repo)
|
||||
self.finalize()
|
||||
else:
|
||||
self.help()
|
||||
|
||||
+6
-10
@@ -150,14 +150,10 @@ def remove_package(name):
|
||||
|
||||
# tracking databases for non-repository information
|
||||
|
||||
thirdparty_packagedb = None
|
||||
inst_packagedb = None
|
||||
thirdparty_packagedb = inst_packagedb = None
|
||||
|
||||
def init():
|
||||
global thirdparty_packagedb
|
||||
global inst_packagedb
|
||||
|
||||
if not thirdparty_packagedb:
|
||||
thirdparty_packagedb = PackageDB('thirdparty')
|
||||
if not inst_packagedb:
|
||||
inst_packagedb = PackageDB('installed')
|
||||
def init_db():
|
||||
if not pisi.packagedb.thirdparty_packagedb:
|
||||
pisi.packagedb.thirdparty_packagedb = PackageDB('thirdparty')
|
||||
if not pisi.packagedb.inst_packagedb:
|
||||
pisi.packagedb.inst_packagedb = PackageDB('installed')
|
||||
|
||||
@@ -76,6 +76,8 @@ class RepoDB(object):
|
||||
return self.d["repo-" + name]
|
||||
|
||||
def add_repo(self, name, repo_info):
|
||||
name = str(name)
|
||||
repo_info = str(repo_info)
|
||||
if self.d.has_key("repo-" + name):
|
||||
raise Error(_('Repository %s already exists') % name)
|
||||
self.d["repo-" + name] = repo_info
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ set -e
|
||||
pisi-cli -Dtmp -E --ignore-build-no build tests/zip/pspec.xml tests/unzip/pspec.xml
|
||||
pisi-cli -Dtmp index .
|
||||
#pisi-cli -Dtmp remove-repo repo1
|
||||
pisi-cli -Dtmp add-repo repo1 pisi-index.xml
|
||||
pisi-cli -Dtmp -d add-repo repo1 pisi-index.xml
|
||||
pisi-cli -Dtmp list-repo
|
||||
pisi-cli -Dtmp update-repo repo1
|
||||
pisi-cli -Dtmp list-available
|
||||
|
||||
Reference in New Issue
Block a user