# Sync the ISC configuartion file and the SQL database
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: alyson,v 1.5 2001-09-27 14:42:02 troup Exp $
+# $Id: alyson,v 1.6 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB;
- apt_pkg.init();
+ Cnf = utils.get_conf()
- 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")];
# Check for fixable discrepancies between stable and unstable
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: andrea,v 1.4 2001-09-27 01:23:41 troup Exp $
+# $Id: andrea,v 1.5 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
apt_pkg.ParseCommandLine(Cnf,[],sys.argv);
# Poolify (move packages from "legacy" type locations to pool locations)
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: catherine,v 1.12 2001-11-04 22:28:44 troup Exp $
+# $Id: catherine,v 1.13 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB;
- apt_pkg.init();
+ Cnf = utils.get_conf()
+
+ for i in ["help", "limit", "no-action", "verose" ]:
+ if not Cnf.has_key("Catherine::Options::%s" % (i)):
+ Cnf["Catherine::Options::%s" % (i)] = "";
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
Arguments = [('h',"help","Catherine::Options::Help"),
('l',"limit", "Catherine::Options::Limit", "HasArg"),
('n',"no-action","Catherine::Options::No-Action"),
('v',"verbose","Catherine::Options::Verbose")];
- for i in ["help", "limit", "no-action", "verose" ]:
- Cnf["Catherine::Options::%s" % (i)] = "";
apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Catherine::Options")
# Generate Maintainers file used by e.g. the Debian Bug Tracking System
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: charisma,v 1.11 2001-09-27 01:23:41 troup Exp $
+# $Id: charisma,v 1.12 2001-11-18 19:57:58 rmurray 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
def main():
global Cnf, projectB;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('h',"help","Charisma::Options::Help")];
- Cnf["Charisma::Options::Help"] = "";
+ if not Cnf.has_key("Charisma::Options::Help"):
+ Cnf["Charisma::Options::Help"] = "";
+
extra_files = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Charisma::Options");
# Compares Packages-Arch-Specific (from Quinn-Diff) against the archive
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: christina,v 1.3 2001-11-04 22:28:44 troup Exp $
+# $Id: christina,v 1.4 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('d',"debug","Christina::Options::Debug", "IntVal"),
('h',"help","Christina::Options::Help"),
# Output override files for apt-ftparchive and indices/
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: cindy,v 1.5 2001-11-04 22:28:44 troup Exp $
+# $Id: cindy,v 1.6 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB, override;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('D',"debug","Denise::Options::Debug", "IntVal"),
('h',"help","Denise::Options::Help"),
('V',"version","Denise::Options::Version")];
# 'Fix' stable to make debian-cd and dpkg -BORGiE users happy
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: claire.py,v 1.10 2001-11-04 20:41:37 troup Exp $
+# $Id: claire.py,v 1.11 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
+ Cnf = utils.get_conf()
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
Arguments = [('h',"help","Claire::Options::Help"),
('v',"verbose","Claire::Options::Verbose")];
for i in ["help", "verbose" ]:
- Cnf["Claire::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Claire::Options::%s" % (i)):
+ Cnf["Claire::Options::%s" % (i)] = "";
apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Claire::Options")
# Output override files for apt-ftparchive and indices/
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: denise,v 1.8 2001-09-17 11:18:37 troup Exp $
+# $Id: denise,v 1.9 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB, override;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('D',"debug","Denise::Options::Debug", "IntVal"),
('h',"help","Denise::Options::Help"),
('V',"version","Denise::Options::Version")];
# Script to automate some parts of checking NEW packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: fernanda,v 1.4 2001-11-04 22:28:44 troup Exp $
+# $Id: fernanda,v 1.5 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB, db_files, waste, excluded;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('h',"help","Fernanda::Options::Help")];
for i in [ "help" ]:
- Cnf["Fernanda::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Frenanda::Options::%s" % (i)):
+ Cnf["Fernanda::Options::%s" % (i)] = "";
args = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Fernanda::Options")
# Remove obsolete .changes files from proposed-updates
# Copyright (C) 2001 James Troup <james@nocrew.org>
-# $Id: halle,v 1.2 2001-11-04 22:28:44 troup Exp $
+# $Id: halle,v 1.3 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB, Options;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('q',"quiet","Halle::Options::Quiet"),
('v',"verbose","Halle::Options::Verbose"),
('h',"help","Halle::Options::Help"),
('V',"version","Halle::Options::Version")];
for i in [ "quiet", "verbose", "help", "debug" ]:
- Cnf["Halle::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Halle::Options::%s" % (i)):
+ Cnf["Halle::Options::%s" % (i)] = "";
arguments = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Halle::Options")
# Manipulate suite tags
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: heidi,v 1.10 2001-11-04 22:40:12 troup Exp $
+# $Id: heidi,v 1.11 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB, Logger;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('a',"add","Heidi::Options::Add", "HasArg"),
('h',"help","Heidi::Options::Help"),
('s',"set", "Heidi::Options::Set", "HasArg")];
for i in ["add", "help", "list", "remove", "set", "version" ]:
- Cnf["Heidi::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Heidi::Options::%s" % (i)):
+ Cnf["Heidi::Options::%s" % (i)] = "";
file_list = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Heidi::Options")
# Generate file list which is then fed to apt-ftparchive to generate Packages and Sources files
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: jenna,v 1.14 2001-09-27 01:22:51 troup Exp $
+# $Id: jenna,v 1.15 2001-11-18 19:57:58 rmurray 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
global Cnf, projectB, Logger;
dislocated_files = {};
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('a',"architecture","Jenna::Options::Architecture", "HasArg"),
('c',"component","Jenna::Options::Component", "HasArg"),
('s',"suite", "Jenna::Options::Suite", "HasArg")];
for i in ["architecture", "component", "help", "suite" ]:
- Cnf["Jenna::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Jenna::Options::%s" % (i)):
+ Cnf["Jenna::Options::%s" % (i)] = "";
apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Jenna::Options");
output = utils.open_file("%s/%s_%s_binary-%s.list" % (Cnf["Dir::ListsDir"], suite, component, architecture), "w");
generate_bin_list(suite, component, architecture, output, "deb", dislocated_files);
output.close();
- if component == "main" and (suite == "unstable" or suite == "testing"): # FIXME: must be a cleaner way to say debian-installer is main only?
+ if component == "main" and (suite == "unstable" or suite == "testing") and Cnf.has_key("Section::debian-installer"): # FIXME: must be a cleaner way to say debian-installer is main only?
Logger.log(["Processing dists/%s/%s/debian-installer/binary-%s..." % (suite,component, architecture)]);
output = utils.open_file("%s/%s_%s_debian-installer_binary-%s.list" % (Cnf["Dir::ListsDir"], suite, component, architecture), "w");
generate_bin_list(suite, component, architecture, output, "udeb", dislocated_files);
# Dependency check proposed-updates
# Copyright (C) 2001 James Troup <james@nocrew.org>
-# $Id: jeri,v 1.2 2001-11-04 22:28:44 troup Exp $
+# $Id: jeri,v 1.3 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB, Options;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('q',"quiet","Jeri::Options::Quiet"),
('v',"verbose","Jeri::Options::Verbose"),
('h',"help","Jeri::Options::Help"),
('V',"version","Jeri::Options::Version")];
for i in [ "quiet", "verbose", "help", "debug" ]:
- Cnf["Jeri::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Jeri::Options::%s" % (i)):
+ Cnf["Jeri::Options::%s" % (i)] = "";
arguments = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Jeri::Options")
# Sync PostgreSQL with (LDAP-generated) passwd file
# Copyright (C) 2001 James Troup <james@nocrew.org>
-# $Id: julia,v 1.3 2001-11-04 22:28:44 troup Exp $
+# $Id: julia,v 1.4 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('q',"quiet","Julia::Options::Quiet"),
('v',"verbose","Julia::Options::Verbose"),
('h',"help","Julia::Options::Help")];
for i in ["quiet", "verbose", "help" ]:
- Cnf["Julia::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Julia::Options::%s" % (i)):
+ Cnf["Julia::Options::%s" % (i)] = "";
arguments = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Julia::Options")
# Installs Debian packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: katie,v 1.62 2001-11-04 22:41:31 troup Exp $
+# $Id: katie,v 1.63 2001-11-18 19:57:58 rmurray 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
legacy_source_untouchable = {};
Subst = {};
nmu = None;
-katie_version = "$Revision: 1.62 $";
+katie_version = "$Revision: 1.63 $";
###############################################################################
def init():
global Cnf, Options;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('a',"automatic","Dinstall::Options::Automatic"),
('h',"help","Dinstall::Options::Help"),
for i in ["automatic", "help", "ack-new", "manual-reject", "no-action",
"no-lock", "no-mail", "override-distribution", "version"]:
- Cnf["Dinstall::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Dinstall::Options::%s" % (i)):
+ Cnf["Dinstall::Options::%s" % (i)] = "";
changes_files = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Dinstall::Options")
# Display information about package(s) (suite, version, etc.)
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: madison,v 1.12 2001-11-04 22:35:11 troup Exp $
+# $Id: madison,v 1.13 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('a',"architecture","Madison::Options::Architecture", "HasArg"),
('s',"suite","Madison::Options::Suite", "HasArg"),
('h',"help","Madison::Options::Help")];
for i in ["architecture", "suite", "help" ]:
- Cnf["Madison::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Madison::Options::%s" % (i)):
+ Cnf["Madison::Options::%s" % (i)] = "";
packages = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Madison::Options")
# General purpose package removal tool for ftpmaster
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: melanie,v 1.18 2001-11-04 22:35:11 troup Exp $
+# $Id: melanie,v 1.19 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('h',"help","Melanie::Options::Help"),
('a',"architecture","Melanie::Options::Architecture", "HasArg"),
];
for i in ["help", "architecture", "binary", "component", "carbon-copy", "done", "reason", "no-action", "partial", "source-only" ]:
- Cnf["Melanie::Options::%s" % (i)] = "";
- Cnf["Melanie::Options::Suite"] = "unstable";
+ if not Cnf.has_key("Melanie::Options::%s" % (i)):
+ Cnf["Melanie::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Melanie::Options::Suite"):
+ Cnf["Melanie::Options::Suite"] = "unstable";
arguments = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Melanie::Options")
Subst["__BCC__"] = "Bcc: " + string.join(bcc, ", ");
else:
Subst["__BCC__"] = "X-Filler: 42";
- Subst["__CC__"] = "X-Melanie: $Revision: 1.18 $";
+ Subst["__CC__"] = "X-Melanie: $Revision: 1.19 $";
if carbon_copy:
Subst["__CC__"] = Subst["__CC__"] + "\nCc: " + string.join(carbon_copy, ", ");
Subst["__SUITE_LIST__"] = suites_list;
# Manipulate override files
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: natalie.py,v 1.12 2001-11-04 22:28:44 troup Exp $
+# $Id: natalie.py,v 1.13 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB, Logger;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('h',"help","Natalie::Options::Help"),
('c',"component", "Natalie::Options::Component", "HasArg"),
('l',"list", "Natalie::Options::List"),
# Default arguments
for i in ["help", "list", "set" ]:
- Cnf["Natalie::Options::%s" % (i)] = "";
- Cnf["Natalie::Options::Component"] = "main";
- Cnf["Natalie::Options::Suite"] = "unstable";
- Cnf["Natalie::Options::Type"] = "deb";
+ if not Cnf.has_key("Natalie::Options::%s" (i)):
+ Cnf["Natalie::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Natalie::Options::Component"):
+ Cnf["Natalie::Options::Component"] = "main";
+ if not Cnf.has_key("Natalie::Options::Suite"):
+ Cnf["Natalie::Options::Suite"] = "unstable";
+ if not Cnf.has_key("Natalie::Options::Type"):
+ Cnf["Natalie::Options::Type"] = "deb";
file_list = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
# Populate the DB
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: neve,v 1.6 2001-11-04 22:41:31 troup Exp $
+# $Id: neve,v 1.7 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB, query_cache, files_query_cache, source_query_cache, src_associations_query_cache, dsc_files_query_cache, bin_associations_query_cache, binaries_query_cache;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
print "Re-Creating DB..."
(result, output) = commands.getstatusoutput("psql -f init_pool.sql")
# Check for obsolete binary packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: rene,v 1.8 2001-11-04 22:28:44 troup Exp $
+# $Id: rene,v 1.9 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
Arguments = [('D',"debug","Catherine::Options::Debug", "IntVal"),
('h',"help","Catherine::Options::Help"),
# rhona, cleans up unassociated binary and source packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: rhona,v 1.17 2001-09-27 01:23:41 troup Exp $
+# $Id: rhona,v 1.18 2001-11-18 19:57:58 rmurray 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
def main():
global Cnf, Options, projectB, delete_date, now_date;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
# Clean incoming of old unused files
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: shania,v 1.8 2001-11-16 21:35:56 rmurray Exp $
+# $Id: shania,v 1.9 2001-11-18 19:57:58 rmurray 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
changes = utils.parse_changes(changes_filename, 0)
files = utils.build_file_list(changes, "");
except:
- utils.warn("error processing '%s'; skipping it. [Got %s]" % (file, sys.exc_type));
+ utils.warn("error processing '%s'; skipping it. [Got %s]" % (changes_filename, sys.exc_type));
continue;
dsc_files = {};
def main ():
global Cnf, Options;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
+ Cnf = utils.get_conf()
for i in ["Help", "Incoming", "No-Action", "Verbose" ]:
- Cnf["Shania::Options::%s" % (i)] = "";
- Cnf["Shania::Options::Days"] = "14";
+ if not Cnf.has_key("Shania::Options::%s" % (i)):
+ Cnf["Shania::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Shania::Options::Days"):
+ Cnf["Shania::Options::Days"] = "14";
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
# Sanity check the database
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: tea,v 1.13 2001-11-04 22:28:44 troup Exp $
+# $Id: tea,v 1.14 2001-11-18 19:57:58 rmurray 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
def main ():
global Cnf, projectB, db_files, waste, excluded;
- apt_pkg.init();
-
- Cnf = apt_pkg.newConfiguration();
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
+ Cnf = utils.get_conf()
apt_pkg.ParseCommandLine(Cnf,[],sys.argv);
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
# Utility functions
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: utils.py,v 1.35 2001-11-04 22:33:22 troup Exp $
+# $Id: utils.py,v 1.36 2001-11-18 19:57:58 rmurray 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
sendmail_failed_exc = "Sendmail invocation failed";
tried_too_hard_exc = "Tried too hard to find a free filename.";
-# Valid components; used by extract_component_from_section() because
-# it doesn't know about Conf from it's caller. FIXME
-
-valid_components = {
- "main": "",
- "contrib": "",
- "non-free": ""
- };
-
default_config = "/etc/katie/katie.conf";
default_apt_config = "/etc/katie/apt.conf";
-DefaultCnf = apt_pkg.newConfiguration();
-apt_pkg.ReadConfigFileISC(DefaultCnf,default_config);
######################################################################################
######################################################################################
-# Prefix and components hardcoded into this like a good'un; need to unhardcod at some
-# stage. [FIXME]
-
def extract_component_from_section(section):
component = "";
component = string.split(section, '/')[0];
if string.lower(component) == "non-us" and string.count(section, '/') > 0:
s = string.split(section, '/')[1];
- if valid_components.has_key(s): # Avoid e.g. non-US/libs
+ if Cnf.has_key("Component::%s" % s): # Avoid e.g. non-US/libs
component = string.split(section, '/')[0]+ '/' + string.split(section, '/')[1];
if string.lower(section) == "non-us":
# Expand default component
if component == "":
- if valid_components.has_key(section):
+ if Cnf.has_key("Component::%s" % section):
component = section;
else:
component = "main";
# sendmail wrapper, takes _either_ a message string or a file as arguments
def send_mail (message, filename):
- #### FIXME, how do I get this out of Cnf in katie?
- sendmail_command = "/usr/sbin/sendmail -odq -oi -t";
-
# Sanity check arguments
if message != "" and filename != "":
raise send_mail_invalid_args_exc;
os.close (fd);
# Invoke sendmail
- (result, output) = commands.getstatusoutput("%s < %s" % (sendmail_command, filename));
+ (result, output) = commands.getstatusoutput("%s < %s" % (Cnf["Dinstall::SendmailCommand"], filename));
if (result != 0):
raise sendmail_failed_exc, output;
def where_am_i ():
res = socket.gethostbyaddr(socket.gethostname());
- database_hostname = DefaultCnf.get("Config::" + res[0] + "::DatabaseHostname");
+ database_hostname = Cnf.get("Config::" + res[0] + "::DatabaseHostname");
if database_hostname:
return database_hostname;
else:
def which_conf_file ():
res = socket.gethostbyaddr(socket.gethostname());
- if DefaultCnf.get("Config::" + res[0] + "::KatieConfig"):
- return DefaultCnf["Config::" + res[0] + "::KatieConfig"]
+ if Cnf.get("Config::" + res[0] + "::KatieConfig"):
+ return Cnf["Config::" + res[0] + "::KatieConfig"]
else:
return default_config;
def which_apt_conf_file ():
res = socket.gethostbyaddr(socket.gethostname());
- if DefaultCnf.get("Config::" + res[0] + "::AptConfig"):
- return DefaultCnf["Config::" + res[0] + "::AptConfig"]
+ if Cnf.get("Config::" + res[0] + "::AptConfig"):
+ return Cnf["Config::" + res[0] + "::AptConfig"]
else:
return default_apt_config;
return string.join(list, sep);
################################################################################
+
+def get_conf():
+ return Cnf;
+
+################################################################################
+
+apt_pkg.init()
+
+Cnf = apt_pkg.newConfiguration();
+apt_pkg.ReadConfigFileISC(Cnf,default_config);
+
+if which_conf_file() != default_config:
+ apt_pkg.ReadConfigFileISC(Cnf,which_conf_file())
+
+################################################################################
# Create all the Release files
# Copyright (C) 2001 Anthony Towns <ajt@debian.org>
-# $Id: ziyi,v 1.9 2001-11-04 22:33:22 troup Exp $
+# $Id: ziyi,v 1.10 2001-11-18 19:57:58 rmurray 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
global Cnf, AptCnf, projectB, out
out = sys.stdout;
-
- apt_pkg.init()
-
- Cnf = apt_pkg.newConfiguration()
- apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file())
+ Cnf = utils.get_conf()
AptCnf = apt_pkg.newConfiguration()
apt_pkg.ReadConfigFileISC(AptCnf,utils.which_apt_conf_file())
Arguments = [('h',"help","Ziyi::Options::Help")];
for i in [ "help" ]:
- Cnf["Ziyi::Options::%s" % (i)] = "";
+ if not Cnf.has_key("Ziyi::Options::%s" % (i)):
+ Cnf["Ziyi::Options::%s" % (i)] = "";
suites = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
Options = Cnf.SubTree("Ziyi::Options")