X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=alyson;h=831f54c4a1d2b7d385ab615c2713037869e87234;hb=0ea570b0ff8bb87f8799053bbd4552d444bbe2f2;hp=62d98723b50fe3ad2816e818f7194c1dc76791f3;hpb=80ba7d5f206f1ddff863968989697d99f6aefde5;p=dak.git diff --git a/alyson b/alyson index 62d98723..831f54c4 100755 --- a/alyson +++ b/alyson @@ -2,7 +2,7 @@ # Sync the ISC configuartion file and the SQL database # Copyright (C) 2000, 2001, 2002 James Troup -# $Id: alyson,v 1.8 2002-05-03 16:06:45 troup Exp $ +# $Id: alyson,v 1.10 2002-10-16 02:47:32 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 @@ -20,8 +20,8 @@ ################################################################################ -import pg, sys, string -import utils, db_access +import pg, sys; +import utils, db_access; import apt_pkg; ################################################################################ @@ -74,7 +74,7 @@ def main (): for name in Cnf.SubTree("Component").List(): Component = Cnf.SubTree("Component::%s" % (name)); description = get(Component, "Description"); - if string.lower(Component.get("MeetsDFSG")) == "true": + if Component.get("MeetsDFSG").lower() == "true": meets_dfsg = "true"; else: meets_dfsg = "false"; @@ -110,8 +110,8 @@ def main (): origin = get(Suite, "Origin"); description = get(Suite, "Description"); projectB.query("INSERT INTO suite (suite_name, version, origin, description) VALUES ('%s', %s, %s, %s)" - % (string.lower(suite), version, origin, description)); - for architecture in Cnf.SubTree("Suite::%s::Architectures" % (suite)).List(): + % (suite.lower(), version, origin, description)); + for architecture in Cnf.ValueList("Suite::%s::Architectures" % (suite)): architecture_id = db_access.get_architecture_id (architecture); if architecture_id < 0: utils.fubar("architecture '%s' not found in architecture table for suite %s." % (architecture, suite)); @@ -122,7 +122,7 @@ def main (): projectB.query("BEGIN WORK"); projectB.query("DELETE FROM override_type"); - for type in Cnf.SubTree("OverrideType").List(): + for type in Cnf.ValueList("OverrideType"): projectB.query("INSERT INTO override_type (type) VALUES ('%s')" % (type)); projectB.query("COMMIT WORK"); @@ -147,12 +147,12 @@ def main (): prefix = ""; else: prefix = ""; - component = string.replace(component, "non-US/", ""); + component = component.replace("non-US/", ""); if component != 'main': suffix = '/' + component; else: suffix = ""; - for section in Cnf.SubTree("Section").List(): + for section in Cnf.ValueList("Section"): projectB.query("INSERT INTO section (section) VALUES ('%s%s%s')" % (prefix, section, suffix)); projectB.query("COMMIT WORK");