X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=contrib%2Fhack.1;fp=contrib%2Fhack.1;h=6a123fdf07b7fcf761ab0c74614a950a57084b78;hb=43722e2ebdfdcc25098483f3fa05b7ee857b1466;hp=0000000000000000000000000000000000000000;hpb=3c5604400b55cf0c093a94ea649a5b20f0a0044a;p=dak.git diff --git a/contrib/hack.1 b/contrib/hack.1 new file mode 100755 index 00000000..6a123fdf --- /dev/null +++ b/contrib/hack.1 @@ -0,0 +1,81 @@ +#!/usr/bin/env python + +# Quick hack to import override files +# Copyright (C) 2000 James Troup +# $Id: hack.1,v 1.1 2001-01-10 05:58:26 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 == "woody": + 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 --set --suite=%s --component=%s --type=%s" % (filename, suite, component, type); + +####################################################################################### + +if __name__ == '__main__': + main() +