3 # Poolify (move packages from "legacy" type locations to pool locations)
4 # Copyright (C) 2000 James Troup <james@nocrew.org>
5 # $Id: catherine,v 1.1 2000-11-24 00:20:11 troup Exp $
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 ################################################################################
27 ################################################################################
32 ################################################################################
39 Cnf = apt_pkg.newConfiguration();
40 apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
42 Arguments = [('d',"debug","Heidi::Options::Debug", "IntVal"),
43 ('h',"help","Heidi::Options::Help"),
44 ('v',"version","Heidi::Options::Version")];
46 amount = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
52 projectB = pg.connect('projectb', 'localhost');
54 db_access.init(Cnf, projectB);
56 if (Cnf["Heidi::Options::Add"] == "" and Cnf["Heidi::Options::Remove"] == "") or (Cnf["Heidi::Options::Add"] != "" and Cnf["Heidi::Options::Remove"] != ""):
58 sys.stderr.write("Need either --add <suite> or --remove <suite> command line argument; not neither or both.\n");
61 for i in ("add", "remove"):
62 suite = Cnf["Heidi::Options::%s" % (i)];
64 if not Cnf.has_key("Suite::%s" % (suite)):
65 sys.stderr.write("Unknown suite %s.\n" %(suite));
68 suite_id = db_access.get_suite_id(suite);
72 for file in file_list:
73 process_file(utils.open_file(file_list[0],'r'), suite_id, action);
75 process_file(sys.stdin, suite_id, action);
77 db_access.init (Cnf, projectB);
79 #######################################################################################
81 if __name__ == '__main__':