]> git.ipfire.org Git - ipfire.org.git/commitdiff
source.ipfire.org: Fix hashing functions.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Mar 2010 18:43:20 +0000 (20:43 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Mar 2010 18:43:20 +0000 (20:43 +0200)
www/webapp/db.py
www/webapp/handlers.py

index 8d816140cf03dc175040cef7fa7c424d938a8f77..1f08817e670047b61ad3c6e3fa17a560eb7f1ae5 100644 (file)
@@ -8,6 +8,9 @@ import os.path
 class HashDatabase(object):
        def __init__(self):
                self.conn = sqlite3.connect("/srv/www/ipfire.org/source/hashes.db")
+               self.conn.isolation_level = None # autocommit mode
+
+               self.prepare()
 
        def __del__(self):
                self.conn.close()
index b2704a43a56637ac47703812c8c27d811a60aa15..3063c462a2426263953906425d7b611b3ef8c595 100644 (file)
@@ -227,7 +227,7 @@ class SourceHandler(BaseHandler):
                                if file in [f["name"] for f in fileobjects]:
                                        continue
 
-                               hash = self.hash_db.get_hash(file)
+                               hash = self.hash_db.get_hash(os.path.join(dir, file)
 
                                if not hash:
                                        hash = "0000000000000000000000000000000000000000"