]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/database.py
support for ~ in versions; use _ as an internal separator instead
[dak.git] / daklib / database.py
index f511d27d21900dc1e5c8880801437338bdd7dbdd..2aad6017c50117c2f94504b390eb567876d75a8f 100644 (file)
@@ -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]