diff options
author | Helmut Grohne <helmut@subdivi.de> | 2014-03-08 12:39:32 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2014-03-08 12:39:32 +0100 |
commit | c6a30cefff55cd247a47fa0a2d4f819592e1202b (patch) | |
tree | 58b6ff52bc6827782c2973f1ce976e245ce5f34c /dedup/utils.py | |
parent | 751f19ec1107c9059ae4834e4b757741ebee6cbd (diff) | |
parent | bb0aea9971bc79d8787d8f034022d0ca803fcab3 (diff) | |
download | debian-dedup-c6a30cefff55cd247a47fa0a2d4f819592e1202b.tar.gz |
Merge branch 'master' into sqlalchemy
In the mean time, the master branch evolved quite a bit and the schema
changed again (eqclass added to function table). The main reason for the
merge is to resolve the large amounts of conflicts once, so development
of the sqlalchemy branch can continue and still benefit from changes in
the master branch such as schema compatibility, adapting the indent
level in web app due to the use of contextlib.closing which resembles
sqlalchemy's "with db.begin() as conn:".
Conflicts:
autoimport.py
dedup/utils.py
readyaml.py
update_sharing.py
webapp.py
Diffstat (limited to 'dedup/utils.py')
-rw-r--r-- | dedup/utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dedup/utils.py b/dedup/utils.py index 6864ad3..fd30378 100644 --- a/dedup/utils.py +++ b/dedup/utils.py @@ -1,3 +1,4 @@ +from debian.debian_support import version_compare import sqlalchemy.event def fetchiter(cursor): @@ -12,3 +13,8 @@ def enable_sqlite_foreign_keys(engine): def pragma_foreign_keys(connection, _): connection.execute("PRAGMA foreign_keys=ON;") +def sqlite_add_version_compare(engine): + @sqlalchemy.event.listens_for(engine, "connect") + def add_version_compare(connection, _): + connection.create_collation("debian_version", version_compare) + connection.create_function("debian_version_compare", 2, version_compare) |