#!/usr/bin/env python # Quick hack to import override files # Copyright (C) 2000 James Troup # $Id: hack.1,v 1.2 2001-01-16 21:52:37 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 # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ################################################################################ import os, pg, sys, string import utils, db_access import apt_pkg; ################################################################################ Cnf = None; projectB = None; ################################################################################ def main (): global Cnf, projectB; apt_pkg.init(); Cnf = apt_pkg.newConfiguration(); apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file()); Arguments = [('D',"debug","Alyson::Options::Debug", "IntVal"), ('h',"help","Alyson::Options::Help"), ('v',"version","Alyson::Options::Version")]; apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv); projectB = pg.connect('projectb', 'localhost'); db_access.init(Cnf, projectB); for filename in os.listdir('.'): if not os.path.isfile(filename) or filename[:9] != 'override.': continue; x = string.split(filename, '.') suite = x[1]; type = "deb"; if suite == "experimental": continue; else: component = x[2]; if suite == "sid": suite = "unstable"; elif suite == "potato": suite = "stable"; else: print "say what?"; sys.exit(3); if len(x) == 4: type = x[3]; if type == "debian-installer": type = "udeb"; elif type == "src": type = "dsc"; else: print "say WHAT?"; sys.exit(4); print "cat %s | natalie.py --set --suite=%s --component=%s --type=%s" % (filename, suite, component, type); ####################################################################################### if __name__ == '__main__': main()