X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdatabase.py;h=2aad6017c50117c2f94504b390eb567876d75a8f;hb=1bcac7a38c0b55aa9a8ec984c44661f92e7bc536;hp=f511d27d21900dc1e5c8880801437338bdd7dbdd;hpb=2dd958f43c0a54b88b8806f0e36fbef05b6af185;p=dak.git diff --git a/daklib/database.py b/daklib/database.py index f511d27d..2aad6017 100644 --- a/daklib/database.py +++ b/daklib/database.py @@ -185,7 +185,7 @@ def get_component_id (component): def get_location_id (location, component, archive): global location_id_cache - cache_key = location + '~' + component + '~' + location + cache_key = location + '_' + component + '_' + location if location_id_cache.has_key(cache_key): return location_id_cache[cache_key] @@ -208,7 +208,7 @@ def get_location_id (location, component, archive): def get_source_id (source, version): global source_id_cache - cache_key = source + '~' + version + '~' + cache_key = source + '_' + version + '_' if source_id_cache.has_key(cache_key): return source_id_cache[cache_key] @@ -278,7 +278,7 @@ def get_or_set_fingerprint_id (fingerprint): def get_files_id (filename, size, md5sum, location_id): global files_id_cache - cache_key = "%s~%d" % (filename, location_id) + cache_key = "%s_%d" % (filename, location_id) if files_id_cache.has_key(cache_key): return files_id_cache[cache_key] @@ -331,7 +331,7 @@ def set_files_id (filename, size, md5sum, location_id): ## ##q = projectB.query("SELECT id FROM files WHERE id = currval('files_id_seq')") ##ql = q.getresult()[0] - ##cache_key = "%s~%d" % (filename, location_id) + ##cache_key = "%s_%d" % (filename, location_id) ##files_id_cache[cache_key] = ql[0] ##return files_id_cache[cache_key]