# Poolify (move packages from "legacy" type locations to pool locations)
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: catherine,v 1.11 2001-09-27 01:22:51 troup Exp $
+# $Id: catherine,v 1.12 2001-11-04 22:28:44 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
destination_filename = base_filename;
# Work out the source package name
if utils.re_isadeb.match(base_filename) != None:
- control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(legacy_filename,"r")))
+ control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(legacy_filename)))
package = control.Find("Package", "");
source = control.Find("Source", package);
if string.find(source, "(") != -1:
if component == "":
q = projectB.query("SELECT DISTINCT(c.name) FROM override o, component c WHERE o.package = '%s' AND o.component = c.id;" % (source));
ql = q.getresult();
- if ql == []:
+ if not ql:
utils.fubar("No override match for '%s' so I can't work out the component." % (source));
if len(ql) > 1:
utils.fubar("Multiple override matches for '%s' so I can't work out the component." % (source));
# Compares Packages-Arch-Specific (from Quinn-Diff) against the archive
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: christina,v 1.2 2001-07-07 03:15:36 troup Exp $
+# $Id: christina,v 1.3 2001-11-04 22:28:44 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
as_source = {};
filename = "/org/buildd.debian.org/web/quinn-diff/Packages-arch-specific";
- file = utils.open_file(filename, 'r');
+ file = utils.open_file(filename);
line_count = 0;
for line in file.readlines():
line = string.strip(utils.re_comments.sub("", line));
# Output override files for apt-ftparchive and indices/
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: cindy,v 1.4 2001-06-22 22:53:14 troup Exp $
+# $Id: cindy,v 1.5 2001-11-04 22:28:44 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
#% (package, suite_id, component_id, type_id));
# Then if source doesn't already have a copy, insert it into source
q = projectB.query("SELECT package FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" % (package, suite_id, component_id, dsc_type_id));
- if q.getresult() == []:
+ if not q.getresult():
#projectB.query("INSERT INTO override (package, suite, component, priority, section, type, maintainer) VALUES ('%s', %s, %s, %s, %s, %s, '%s')" % (package, suite_id, component_id, i[1], i[2], dsc_type_id, i[3]));
print "(nop)"
else: # dsc
# Fix for bug in katie where dsc_files was initialized from changes and not dsc
# Copyright (C) 2000 James Troup <james@nocrew.org>
-# $Id: fix.9,v 1.2 2000-12-18 07:11:25 troup Exp $
+# $Id: fix.9,v 1.3 2001-11-04 22:28:44 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
dsc_files = utils.build_file_list(dsc, 1);
q = projectB.query("SELECT s.id, l.id, l.path FROM source s, location l, files f WHERE s.source = '%s' AND s.version = '%s' AND f.id = s.file AND f.location = l.id" % (dsc["source"], dsc["version"]));
ql = q.getresult();
- if ql == [] or len(ql) > 1:
+ if not ql or len(ql) > 1:
print " EEEEEEEEEEEEEEK!!!"
print " ",base_dsc_file
source_id = ql[0][0];
# Script to automate some parts of checking NEW packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: fernanda,v 1.3 2001-09-27 01:22:51 troup Exp $
+# $Id: fernanda,v 1.4 2001-11-04 22:28:44 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
files = utils.build_file_list(dsc, 1);
print "---- .dsc file for %s ----" % (dsc_filename);
- dsc_file = utils.open_file(dsc_filename, 'r');
+ dsc_file = utils.open_file(dsc_filename);
for line in dsc_file.readlines():
print line[:-1];
print;
changes = utils.parse_changes (changes_filename, 0);
print "---- .changes file for %s ----" % (changes_filename);
- file = utils.open_file (changes_filename, 'r');
+ file = utils.open_file (changes_filename);
for line in file.readlines():
print line[:-1]
print ;
# Remove obsolete .changes files from proposed-updates
# Copyright (C) 2001 James Troup <james@nocrew.org>
-# $Id: halle,v 1.1 2001-11-04 20:41:50 troup Exp $
+# $Id: halle,v 1.2 2001-11-04 22:28:44 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
if Options["Help"]:
usage(0);
- if arguments == []:
+ if not arguments:
utils.fubar("need at least one package name as an argument.");
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
# Dependency check proposed-updates
# Copyright (C) 2001 James Troup <james@nocrew.org>
-# $Id: jeri,v 1.1 2001-11-04 20:41:50 troup Exp $
+# $Id: jeri,v 1.2 2001-11-04 22:28:44 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
if Options["Help"]:
usage(0);
- if arguments == []:
+ if not arguments:
utils.fubar("need at least one package name as an argument.");
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
# Sync PostgreSQL with (LDAP-generated) passwd file
# Copyright (C) 2001 James Troup <james@nocrew.org>
-# $Id: julia,v 1.2 2001-09-27 01:23:41 troup Exp $
+# $Id: julia,v 1.3 2001-11-04 22:28:44 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
if Options["Help"]:
usage();
- if arguments == []:
+ if not arguments:
utils.warn("julia needs the name of the passwd file to sync with as an argument.");
usage(1);
elif len(arguments) > 1:
# Manipulate override files
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: natalie.py,v 1.11 2001-09-27 01:23:41 troup Exp $
+# $Id: natalie.py,v 1.12 2001-11-04 22:28:44 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
Logger = logging.Logger(Cnf, "natalie");
if file_list != []:
for file in file_list:
- process_file(utils.open_file(file,'r'), suite, component, type);
+ process_file(utils.open_file(file), suite, component, type);
else:
process_file(sys.stdin, suite, component, type);
Logger.close();
# Check for obsolete binary packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: rene,v 1.7 2001-07-25 15:51:15 troup Exp $
+# $Id: rene,v 1.8 2001-11-04 22:28:44 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
global Cnf, projectB;
apt_pkg.init();
-
+
Cnf = apt_pkg.newConfiguration();
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
if (result != 0):
sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output));
sys.exit(result);
- sources = utils.open_file(temp_filename, 'r');
+ sources = utils.open_file(temp_filename);
Sources = apt_pkg.ParseTagFile(sources);
while Sources.Step():
source = Sources.Section.Find('Package');
binary = string.strip(binary);
q = projectB.query("SELECT a.arch_string, b.version FROM binaries b, bin_associations ba, architecture a WHERE ba.suite = %s AND ba.bin = b.id AND b.architecture = a.id AND b.package = '%s'" % (suite_id, binary));
ql = q.getresult();
- if ql == []:
+ if not ql:
utils.warn("%s lists %s as a binary, but it doesn't seem to exist in %s?" % (source, binary, suite));
# Loop around twice; first to get the latest 'valid' version
versions = [];
print "** mwaap, mwapp! Ignore me **";
continue;
if apt_pkg.VersionCompare(latest_version, version) != -1:
- print "- out of date.",
+ print "- out of date.",
else:
print "- current.",
print "[%s vs %s (%s)]" % (latest_version, version, arch);
-
+
# Check for duplicated packages and build indices for checking "no source" later
source_index = component + '/' + source;
if src_pkgs.has_key(source):
if [ "source", "all" ].count(architecture) != 0:
continue;
filename = "%s/dists/%s/%s/binary-%s/Packages" % (Cnf["Dir::RootDir"], suite, component, architecture);
- packages = utils.open_file(filename, 'r');
+ packages = utils.open_file(filename);
Packages = apt_pkg.ParseTagFile(packages);
while Packages.Step():
package = Packages.Section.Find('Package');
suite_id = db_access.get_suite_id("unstable");
q = projectB.query("""
-SELECT s.source, s.version AS experimental, s2.version AS unstable
- FROM src_associations sa, source s, source s2, src_associations sa2
- WHERE sa.suite = 1 AND sa2.suite = %d AND sa.source = s.id
- AND sa2.source = s2.id AND s.source = s2.source
+SELECT s.source, s.version AS experimental, s2.version AS unstable
+ FROM src_associations sa, source s, source s2, src_associations sa2
+ WHERE sa.suite = 1 AND sa2.suite = %d AND sa.source = s.id
+ AND sa2.source = s2.id AND s.source = s2.source
AND versioncmp(s.version, s2.version) < 0""" % (suite_id));
ql = q.getresult();
if ql != []:
# Sanity check the database
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: tea,v 1.12 2001-09-27 01:23:41 troup Exp $
+# $Id: tea,v 1.13 2001-11-04 22:28:44 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
if os.access(filename, os.R_OK) == 0:
utils.warn("'%s' doesn't exist." % (filename));
- file = utils.open_file(Cnf["Dir::OverrideDir"]+'override.unreferenced','r');
+ file = utils.open_file(Cnf["Dir::OverrideDir"]+'override.unreferenced');
for filename in file.readlines():
filename = filename[:-1];
excluded[filename] = "";
continue;
component = string.lower(component);
list_filename = '%s%s_%s_source.list' % (Cnf["Dir::ListsDir"], suite, component);
- list_file = utils.open_file(list_filename, 'r');
+ list_file = utils.open_file(list_filename);
for line in list_file.readlines():
file = line[:-1];
try:
db_md5sum = i[2];
db_size = int(i[3]);
try:
- file = utils.open_file(filename, 'r');
+ file = utils.open_file(filename);
except:
utils.warn("can't open '%s'." % (filename));
continue;