X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=cindy;h=367e1e57fe668a566287253e2ab13883baffd069;hb=6ada259d555e36a1546789c280edc3f944b7de7f;hp=af4370380b677125ec3c80d46dd9e0955b070319;hpb=4b41dc06229eed89f52f397fc7df5d665fa092cf;p=dak.git diff --git a/cindy b/cindy index af437038..367e1e57 100755 --- a/cindy +++ b/cindy @@ -1,8 +1,8 @@ #!/usr/bin/env python # Output override files for apt-ftparchive and indices/ -# Copyright (C) 2000 James Troup -# $Id: cindy,v 1.1 2001-01-16 21:52:37 troup Exp $ +# Copyright (C) 2000, 2001 James Troup +# $Id: cindy,v 1.4 2001-06-22 22:53:14 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 @@ -18,6 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +################################################################################ # X-Listening-To: Sanitarium / Master of the Puppets - Metallica @@ -40,18 +41,15 @@ def process(suite, component, type): suite_id = db_access.get_suite_id(suite); if suite_id == -1: - sys.stderr.write("Suite '%s' not recognised.\n" % (suite)); - sys.exit(2); + utils.fubar("Suite '%s' not recognised." % (suite)); component_id = db_access.get_component_id(component); if component_id == -1: - sys.stderr.write("Component '%s' not recognised.\n" % (component)); - sys.exit(2); + utils.fubar("Component '%s' not recognised." % (component)); type_id = db_access.get_override_type_id(type); if type_id == -1: - sys.stderr.write("Type '%s' not recognised. (Valid types are deb, udeb and dsc.)\n" % (type)); - sys.exit(2); + utils.fubar("Type '%s' not recognised. (Valid types are deb, udeb and dsc)" % (type)); dsc_type_id = db_access.get_override_type_id("dsc"); if type == "deb" or type == "udeb": @@ -73,21 +71,22 @@ def process(suite, component, type): if not packages.has_key(package): if not src_packages.has_key(package): print "DELETING: %s" % (package); - projectB.query("DELETE FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" - % (package, suite_id, component_id, type_id)); + #projectB.query("DELETE FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" + #% (package, suite_id, component_id, type_id)); else: print "MAKING SOURCE: %s" % (package); - projectB.query("DELETE FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" - % (package, suite_id, component_id, type_id)); + #projectB.query("DELETE FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" + #% (package, suite_id, component_id, type_id)); # Then if source doesn't already have a copy, insert it into source q = projectB.query("SELECT package FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" % (package, suite_id, component_id, dsc_type_id)); if q.getresult() == []: - projectB.query("INSERT INTO override (package, suite, component, priority, section, type, maintainer) VALUES ('%s', %s, %s, %s, %s, %s, '%s')" % (package, suite_id, component_id, i[1], i[2], dsc_type_id, i[3])); + #projectB.query("INSERT INTO override (package, suite, component, priority, section, type, maintainer) VALUES ('%s', %s, %s, %s, %s, %s, '%s')" % (package, suite_id, component_id, i[1], i[2], dsc_type_id, i[3])); + print "(nop)" else: # dsc if not src_packages.has_key(package): print "DELETING: %s" % (package); - projectB.query("DELETE FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" - % (package, suite_id, component_id, type_id)); + #projectB.query("DELETE FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" + #% (package, suite_id, component_id, type_id)); projectB.query("COMMIT WORK"); @@ -105,11 +104,11 @@ def main (): ('V',"version","Denise::Options::Version")]; apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv); - projectB = pg.connect('projectb', 'localhost'); + projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); db_access.init(Cnf, projectB); for suite in [ "stable", "unstable" ]: - sys.stderr.write("Processing %s...\n" % (suite)); + print "Processing %s..." % (suite); for component in Cnf.SubTree("Component").List(): if component == "mixed": continue; # Ick