#!/usr/bin/env python
# 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 $
+# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
+# $Id: denise,v 1.11 2002-05-14 15:28:53 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
################################################################################
import pg, sys, string
-import utils, db_access, natalie
+import utils, db_access
import apt_pkg;
################################################################################
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")];
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
db_access.init(Cnf, projectB);
- natalie.init();
-
for suite in [ "stable", "unstable" ]:
sys.stderr.write("Processing %s...\n" % (suite));
override_suite = Cnf["Suite::%s::OverrideCodeName" % (suite)];
for component in Cnf.SubTree("Component").List():
if component == "mixed":
continue; # Ick
- for type in Cnf.SubTree("OverrideType").List():
+ for type in Cnf.ValueList("OverrideType"):
if type == "deb":
override_type = "";
elif type == "udeb":
override_type = ".debian-installer";
elif type == "dsc":
override_type = ".src";
- filename = "%s/override.%s.%s%s" % (Cnf["Dir::OverrideDir"], override_suite, string.replace(component, "non-US/", ""), override_type);
+ filename = "%s/override.%s.%s%s" % (Cnf["Dir::Override"], override_suite, string.replace(component, "non-US/", ""), override_type);
file = utils.open_file(filename, 'w');
sys.stdout = file;
list(suite, component, type);
if component == "mixed":
continue;
component_id = db_access.get_component_id(component);
- for type in Cnf.SubTree("OverrideType").List():
+ for type in Cnf.ValueList("OverrideType"):
if type == "deb":
override_type = "";
q = projectB.query("SELECT DISTINCT b.package FROM bin_associations ba, binaries b, files f, location l WHERE ba.suite = %s AND l.component = %s AND ba.bin = b.id AND b.file = f.id AND f.location = l.id" % (suite_id, component_id));