X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=db_access.py;h=0b038862688ae2c7f9eaa48c64da1aff28679d53;hb=4df20c3923c3b768e31030a436b77829f56776ac;hp=8760d91bbd475f801281dabb8e7d29f00ebaa27b;hpb=bb8283ad6274e461fc78a00b2a52c6594c53e13d;p=dak.git diff --git a/db_access.py b/db_access.py index 8760d91b..0b038862 100644 --- a/db_access.py +++ b/db_access.py @@ -1,6 +1,6 @@ # DB access fucntions # Copyright (C) 2000 James Troup -# $Id: db_access.py,v 1.3 2000-12-05 04:27:48 troup Exp $ +# $Id: db_access.py,v 1.4 2000-12-18 07:11:25 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -156,13 +156,14 @@ def get_files_id (filename, size, md5sum, location_id): if files_id_cache.has_key(cache_key): return files_id_cache[cache_key] + size = int(size); q = projectB.query("SELECT id, size, md5sum FROM files WHERE filename = '%s' AND location = %d" % (filename, location_id)); ql = q.getresult(); if ql: if len(ql) != 1: return -1; ql = ql[0] - orig_size = ql[1]; + orig_size = int(ql[1]); orig_md5sum = ql[2]; if orig_size != size or orig_md5sum != md5sum: return -2;