X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=db_access.py;h=afbddeeba1cd32cc35b933719b571f95c13f0869;hb=40e7b810f7eb7d27d69622849f450f41645afa41;hp=2fe45177bce8022a91ddbaf994d1305254c39370;hpb=c30e23562021f4ead23579ed4206f7acb3201204;p=dak.git diff --git a/db_access.py b/db_access.py index 2fe45177..afbddeeb 100644 --- a/db_access.py +++ b/db_access.py @@ -1,6 +1,6 @@ # DB access fucntions # Copyright (C) 2000, 2001 James Troup -# $Id: db_access.py,v 1.9 2001-11-04 22:34:02 troup Exp $ +# $Id: db_access.py,v 1.10 2001-11-24 18:42:05 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 @@ -128,10 +128,12 @@ def get_architecture_id (architecture): def get_archive_id (archive): global archive_id_cache + archive = string.lower(archive); + if archive_id_cache.has_key(archive): return archive_id_cache[archive] - q = projectB.query("SELECT id FROM archive WHERE name = '%s'" % (archive)) + q = projectB.query("SELECT id FROM archive WHERE lower(name) = '%s'" % (archive)); ql = q.getresult(); if not ql: return -1; @@ -144,10 +146,12 @@ def get_archive_id (archive): def get_component_id (component): global component_id_cache + component = string.lower(component); + if component_id_cache.has_key(component): return component_id_cache[component] - q = projectB.query("SELECT id FROM component WHERE lower(name) = '%s'" % (string.lower(component))) + q = projectB.query("SELECT id FROM component WHERE lower(name) = '%s'" % (component)) ql = q.getresult(); if not ql: return -1;