* fix: I want to use BTree not hash. who reverted that? :/

* use bsddb3
* check-source-repo: print version
* install pisi.search
* search: close db if init'd
This commit is contained in:
Eray Özkural
2005-12-07 10:28:07 +00:00
parent c04c515fd2
commit 5af4c97152
8 changed files with 11 additions and 16 deletions
+3 -3
View File
@@ -12,8 +12,8 @@
# #
# Authors: Eray Ozkural <eray@uludag.org.tr> # Authors: Eray Ozkural <eray@uludag.org.tr>
import bsddb.dbshelve as shelve import bsddb3.dbshelve as shelve
import bsddb.db as db import bsddb3.db as db
import os import os
import fcntl import fcntl
import types import types
@@ -32,7 +32,7 @@ class LockedDBShelf(shelve.DBShelf):
"""A simple wrapper to implement locking for bsddb's dbshelf""" """A simple wrapper to implement locking for bsddb's dbshelf"""
def __init__(self, dbname, mode=0644, def __init__(self, dbname, mode=0644,
filetype=db.DB_HASH, dbenv=None): filetype=db.DB_BTREE, dbenv=None):
shelve.DBShelf.__init__(self, dbenv) shelve.DBShelf.__init__(self, dbenv)
filename = os.path.join( pisi.context.config.db_dir(), dbname + '.bdb') filename = os.path.join( pisi.context.config.db_dir(), dbname + '.bdb')
if os.access(os.path.dirname(filename), os.W_OK): if os.access(os.path.dirname(filename), os.W_OK):
-2
View File
@@ -19,9 +19,7 @@
# we basically store everything in PackageInfo class # we basically store everything in PackageInfo class
# yes, we are cheap # yes, we are cheap
import bsddb.dbshelve as shelve
import os, fcntl import os, fcntl
from bsddb import db
import gettext import gettext
__trans = gettext.translation('pisi', fallback=True) __trans = gettext.translation('pisi', fallback=True)
-1
View File
@@ -12,7 +12,6 @@
# Author: Eray Ozkural # Author: Eray Ozkural
from bsddb import db
import os, fcntl import os, fcntl
import gettext import gettext
+5 -5
View File
@@ -41,11 +41,11 @@ def init(ids, langs):
def finalize(): def finalize():
import pisi.context as ctx import pisi.context as ctx
for id in ctx.invidx.iterkeys(): if ctx.invidx:
for lang in ctx.invidx[id].iterkeys(): for id in ctx.invidx.iterkeys():
ctx.invidx[id][lang].close() for lang in ctx.invidx[id].iterkeys():
ctx.invidx[id][lang].close()
ctx.invidx = {} ctx.invidx = {}
def add_doc(id, lang, docid, str): def add_doc(id, lang, docid, str):
terms = preprocess(lang, str) terms = preprocess(lang, str)
-2
View File
@@ -18,10 +18,8 @@ we basically store everything in sourceinfo class
yes, we are cheap yes, we are cheap
""" """
import bsddb.dbshelve as shelve
import os import os
import fcntl import fcntl
from bsddb import db
import gettext import gettext
__trans = gettext.translation('pisi', fallback=True) __trans = gettext.translation('pisi', fallback=True)
+1 -1
View File
@@ -64,7 +64,7 @@ setup(name="pisi",
author_email="pisi@uludag.org.tr", author_email="pisi@uludag.org.tr",
url="http://www.uludag.org.tr/eng/pisi/", url="http://www.uludag.org.tr/eng/pisi/",
package_dir = {'': ''}, package_dir = {'': ''},
packages = ['pisi', 'pisi.cli', 'pisi.actionsapi', 'pisi.pxml'], packages = ['pisi', 'pisi.cli', 'pisi.actionsapi', 'pisi.pxml', 'pisi.search'],
scripts = ['pisi-cli', 'tools/ebuild2pisi.py', 'tools/repostats.py', scripts = ['pisi-cli', 'tools/ebuild2pisi.py', 'tools/repostats.py',
'tools/find-lib-deps.py', 'tools/update-environ.py', 'tools/find-lib-deps.py', 'tools/update-environ.py',
'tools/lspisi'], 'tools/lspisi'],
+1 -1
View File
@@ -12,7 +12,7 @@
# Author: Eray Ozkural <eray@uludag.org.tr> # Author: Eray Ozkural <eray@uludag.org.tr>
import sys import sys
import bsddb.dbshelve as shelve import bsddb3.dbshelve as shelve
sys.path.append('.') sys.path.append('.')
+1 -1
View File
@@ -27,6 +27,6 @@ for root, dirs, files in os.walk(repo_uri):
sf = specfile.SpecFile() sf = specfile.SpecFile()
sf.read(pisi.util.join_path(root, fn)) sf.read(pisi.util.join_path(root, fn))
sf.check() sf.check()
print sf.source.name print '%s: %s' % (sf.source.name, sf.source.version)
pisi.api.finalize() pisi.api.finalize()