Kaydet (Commit) 5af4c971 authored tarafından Eray Özkural's avatar Eray Özkural

* 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
üst c04c515f
......@@ -12,8 +12,8 @@
#
# Authors: Eray Ozkural <eray@uludag.org.tr>
import bsddb.dbshelve as shelve
import bsddb.db as db
import bsddb3.dbshelve as shelve
import bsddb3.db as db
import os
import fcntl
import types
......@@ -32,7 +32,7 @@ class LockedDBShelf(shelve.DBShelf):
"""A simple wrapper to implement locking for bsddb's dbshelf"""
def __init__(self, dbname, mode=0644,
filetype=db.DB_HASH, dbenv=None):
filetype=db.DB_BTREE, dbenv=None):
shelve.DBShelf.__init__(self, dbenv)
filename = os.path.join( pisi.context.config.db_dir(), dbname + '.bdb')
if os.access(os.path.dirname(filename), os.W_OK):
......
......@@ -19,9 +19,7 @@
# we basically store everything in PackageInfo class
# yes, we are cheap
import bsddb.dbshelve as shelve
import os, fcntl
from bsddb import db
import gettext
__trans = gettext.translation('pisi', fallback=True)
......
......@@ -12,7 +12,6 @@
# Author: Eray Ozkural
from bsddb import db
import os, fcntl
import gettext
......
......@@ -41,11 +41,11 @@ def init(ids, langs):
def finalize():
import pisi.context as ctx
for id in ctx.invidx.iterkeys():
for lang in ctx.invidx[id].iterkeys():
ctx.invidx[id][lang].close()
ctx.invidx = {}
if ctx.invidx:
for id in ctx.invidx.iterkeys():
for lang in ctx.invidx[id].iterkeys():
ctx.invidx[id][lang].close()
ctx.invidx = {}
def add_doc(id, lang, docid, str):
terms = preprocess(lang, str)
......
......@@ -18,10 +18,8 @@ we basically store everything in sourceinfo class
yes, we are cheap
"""
import bsddb.dbshelve as shelve
import os
import fcntl
from bsddb import db
import gettext
__trans = gettext.translation('pisi', fallback=True)
......
......@@ -64,7 +64,7 @@ setup(name="pisi",
author_email="pisi@uludag.org.tr",
url="http://www.uludag.org.tr/eng/pisi/",
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',
'tools/find-lib-deps.py', 'tools/update-environ.py',
'tools/lspisi'],
......
......@@ -12,7 +12,7 @@
# Author: Eray Ozkural <eray@uludag.org.tr>
import sys
import bsddb.dbshelve as shelve
import bsddb3.dbshelve as shelve
sys.path.append('.')
......
......@@ -27,6 +27,6 @@ for root, dirs, files in os.walk(repo_uri):
sf = specfile.SpecFile()
sf.read(pisi.util.join_path(root, fn))
sf.check()
print sf.source.name
print '%s: %s' % (sf.source.name, sf.source.version)
pisi.api.finalize()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment