o Don't do override checks for stable only uploads
o cron.daily* should change umask (aj sucks)
o Rene doesn't look at debian-installer but should.
+ o Rene needs to check for binary-less source packages.
- * Bizzare:
+ * Bizzare/uncertain:
- o Fix rhona to unconditionally read override file on startup (huh? no override reading at all!)
o validate source consistency, i.e. .dsc and .tar.gz as minimum (??)
o Rene also doesn't seem to warn about missing binary packages (??)
+ o jenna should not delete things because they don't exist (?)
* Cleanups & misc:
# Poolify (move packages from "legacy" type locations to pool locations)
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: catherine,v 1.9 2001-06-05 22:30:43 troup Exp $
+# $Id: catherine,v 1.10 2001-06-22 22:53:14 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
legacy_filename = qid["path"]+qid["filename"];
size = os.stat(legacy_filename)[stat.ST_SIZE];
if (poolized_size + size) > limit and limit >= 0:
- sys.stderr.write("Hit %s limit.\n" % (utils.size_type(limit)));
+ utils.warn("Hit %s limit." % (utils.size_type(limit)));
break;
poolized_size = poolized_size + size;
poolized_count = poolized_count + 1;
version = control.Find("Version", "");
architecture = control.Find("Architecture", "");
if package == "" or version == "" or architecture == "":
- sys.stderr.write("%s: couldn't determine required information to rename .deb file.\n" % (legacy_filename));
- sys.exit(1);
+ utils.fubar("%s: couldn't determine required information to rename .deb file." % (legacy_filename));
version = utils.re_no_epoch.sub('', version);
destination_filename = "%s_%s_%s.deb" % (package, version, architecture);
else:
if m != None:
source = m.group(1);
else:
- sys.stderr.write("%s: say what?\n" % (legacy_filename));
- sys.exit(1);
+ utils.fubar("expandsion of source filename '%s' failed." % (legacy_filename));
# Work out the component name
component = qid["component"];
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 == []:
- sys.stderr.write("%s: No override match so I can't work out the component.\n" % (source));
- sys.exit(1);
+ utils.fubar("No override match for '%s' so I can't work out the component." % (source));
if len(ql) > 1:
- sys.stderr.write("%s: multiple override matches for %s so I can't work out the component.\n" % (source));
- sys.exit(1);
+ utils.fubar("Multiple override matches for '%s' so I can't work out the component." % (source));
component = ql[0][0];
# Work out the new location
q = projectB.query("SELECT l.id FROM location l, component c WHERE c.name = '%s' AND c.id = l.component AND l.type = 'pool';" % (component));
ql = q.getresult();
if len(ql) != 1:
- sys.stderr.write("%s: couldn't determine location ID, query returned %d matches and not 1 as expected.\n" % (source, len(ql)));
- sys.exit(1);
+ utils.fubar("couldn't determine location ID for '%s'. [query returned %d matches, not 1 as expected]" % (source, len(ql)));
location_id = ql[0][0];
# First move the files to the new location
pool_location = utils.poolify (source, component);
pool_filename = pool_location + destination_filename;
destination = Cnf["Dir::PoolDir"] + pool_location + destination_filename;
if os.path.exists(destination):
- sys.stderr.write("%s: already exists in the pool; serious FUBARity.\n" % (legacy_filename));
- sys.exit(1);
+ utils.fubar("'%s' already exists in the pool; serious FUBARity." % (legacy_filename));
if verbose:
print "Moving: %s -> %s" % (legacy_filename, destination);
if not no_action:
# Sanity check the limit argument
if limit > 0 and limit < 1024:
- sys.stderr.write("-l/--limit takes an argument with a value in kilobytes.\n");
- sys.exit(1);
+ utils.fubar("-l/--limit takes an argument with a value in kilobytes.");
# Grab a list of all files not already in the pool
q = projectB.query("""
# Output override files for apt-ftparchive and indices/
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: cindy,v 1.3 2001-03-20 00:28:11 troup Exp $
+# $Id: cindy,v 1.4 2001-06-22 22:53:14 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
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+################################################################################
# X-Listening-To: Sanitarium / Master of the Puppets - Metallica
suite_id = db_access.get_suite_id(suite);
if suite_id == -1:
- sys.stderr.write("Suite '%s' not recognised.\n" % (suite));
- sys.exit(2);
+ utils.fubar("Suite '%s' not recognised." % (suite));
component_id = db_access.get_component_id(component);
if component_id == -1:
- sys.stderr.write("Component '%s' not recognised.\n" % (component));
- sys.exit(2);
+ utils.fubar("Component '%s' not recognised." % (component));
type_id = db_access.get_override_type_id(type);
if type_id == -1:
- sys.stderr.write("Type '%s' not recognised. (Valid types are deb, udeb and dsc.)\n" % (type));
- sys.exit(2);
+ utils.fubar("Type '%s' not recognised. (Valid types are deb, udeb and dsc)" % (type));
dsc_type_id = db_access.get_override_type_id("dsc");
if type == "deb" or type == "udeb":
db_access.init(Cnf, projectB);
for suite in [ "stable", "unstable" ]:
- sys.stderr.write("Processing %s...\n" % (suite));
+ print "Processing %s..." % (suite);
for component in Cnf.SubTree("Component").List():
if component == "mixed":
continue; # Ick
# Output override files for apt-ftparchive and indices/
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: denise,v 1.4 2001-03-20 00:28:11 troup Exp $
+# $Id: denise,v 1.5 2001-06-22 22:53:14 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
suite_id = db_access.get_suite_id(suite);
if suite_id == -1:
- sys.stderr.write("Suite '%s' not recognised.\n" % (suite));
- sys.exit(2);
+ utils.fubar("Suite '%s' not recognised." % (suite));
component_id = db_access.get_component_id(component);
if component_id == -1:
- sys.stderr.write("Component '%s' not recognised.\n" % (component));
- sys.exit(2);
+ utils.fubar("Component '%s' not recognised." % (component));
type_id = db_access.get_override_type_id(type);
if type_id == -1:
- sys.stderr.write("Type '%s' not recognised. (Valid types are deb, udeb and dsc.)\n" % (type));
- sys.exit(2);
+ utils.fubar("Type '%s' not recognised. (Valid types are deb, udeb and dsc)" % (type));
if not override.has_key(suite):
override[suite] = {};
natalie.init();
for suite in [ "stable", "unstable" ]:
- sys.stderr.write("Processing %s...\n" % (suite));
+ print "Processing %s..." % (suite);
override_suite = Cnf["Suite::%s::OverrideCodeName" % (suite)];
for component in Cnf.SubTree("Component").List():
if component == "mixed":
# Munge the override file for testing by using unstable's where
# possible and falling back on stable's where it's not.
- sys.stderr.write("Processing testing...\n");
+ print "Processing testing...";
suite = "testing";
suite_id = db_access.get_suite_id(suite);
override_suite = Cnf["Suite::%s::OverrideCodeName" % (suite)];
else:
if type == "dsc" and (override["unstable"][component]["deb"].has_key(package) or override["stable"][component]["deb"].has_key(package)):
continue; # source falls back on binary; so accept silently
- sys.stderr.write("W: Can't find override entry for testing package '%s' (component %s, type %s).\n" % (package, component, type));
+ utils.warn("Can't find override entry for testing package '%s' (component %s, type %s)." % (package, component, type));
sys.stdout.close();
# Script to automate some parts of checking NEW packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: fernanda,v 1.1 2001-06-15 01:18:25 troup Exp $
+# $Id: fernanda,v 1.2 2001-06-22 22:53:14 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
sys.stdout = stdout_fd;
except IOError, e:
if errno.errorcode[e.errno] == 'EPIPE':
- utils.warn("[fernanda] Caught EPIPE; skipping.\n");
+ utils.warn("[fernanda] Caught EPIPE; skipping.");
pass;
else:
raise;
except KeyboardInterrupt:
- utils.warn("[fernanda] Caught C-c; skipping.\n");
+ utils.warn("[fernanda] Caught C-c; skipping.");
pass;
#######################################################################################
# Manipulate suite tags
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: heidi,v 1.6 2001-06-20 18:47:37 troup Exp $
+# $Id: heidi,v 1.7 2001-06-22 22:53:14 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
for line in lines:
split_line = string.split(string.strip(line[:-1]));
if len(split_line) != 3:
- sys.stderr.write("W: '%s' does not break into 'package version architecture'.\n" % (line[:-1]));
+ utils.warn("'%s' does not break into 'package version architecture'." % (line[:-1]));
continue;
(package, version, architecture) = split_line;
ql = q.getresult();
if ql == []:
- sys.stderr.write("W: Couldn't find '%s~%s~%s'.\n" % (package, version, architecture));
+ utils.warn("Couldn't find '%s~%s~%s'." % (package, version, architecture));
continue;
if len(ql) > 1:
- sys.stderr.write("E: Found more than one match for '%s~%s~%s'.\n" % (package, version, architecture));
+ utils.warn("Found more than one match for '%s~%s~%s'." % (package, version, architecture));
continue;
id = ql[0][0];
# Take action
if action == "add":
if assoication_id != None:
- sys.stderr.write("W: '%s~%s~%s' already exists in suite %s.\n" % (package, version, architecture, suite_id));
+ utils.warn("'%s~%s~%s' already exists in suite %s." % (package, version, architecture, suite_id));
continue;
else:
q = projectB.query("INSERT INTO src_associations (suite, source) VALUES (%s, %s)" % (suite_id, id));
elif action == "remove":
if assoication_id == None:
- sys.stderr.write("W: '%s~%s~%s' doesn't exist in suite %s.\n" % (package, version, architecture, suite_id));
+ utils.warn("'%s~%s~%s' doesn't exist in suite %s." % (package, version, architecture, suite_id));
continue;
else:
q = projectB.query("DELETE FROM src_associations WHERE id = %s" % (assoication_id));
# Take action
if action == "add":
if assoication_id != None:
- sys.stderr.write("W: '%s~%s~%s' already exists in suite %s.\n" % (package, version, architecture, suite_id));
+ utils.warn("'%s~%s~%s' already exists in suite %s." % (package, version, architecture, suite_id));
continue;
else:
q = projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%s, %s)" % (suite_id, id));
elif action == "remove":
if assoication_id == None:
- sys.stderr.write("W: '%s~%s~%s' doesn't exist in suite %s.\n" % (package, version, architecture, suite_id));
+ utils.warn("'%s~%s~%s' doesn't exist in suite %s." % (package, version, architecture, suite_id));
continue;
else:
q = projectB.query("DELETE FROM bin_associations WHERE id = %s" % (assoication_id));
suite = Cnf["Heidi::Options::%s" % (i)];
if suite !="":
if not Cnf.has_key("Suite::%s" % (suite)):
- sys.stderr.write("Unknown suite %s.\n" %(suite));
- sys.exit(2);
+ utils.fubar("Unknown suite '%s'." %(suite));
else:
suite_id = db_access.get_suite_id(suite);
if action != None:
- sys.stderr.write("Can only do one action at a time.\n");
- sys.exit(2);
+ utils.fubar("Can only perform one action at a time.");
action = i;
# Need an action...
if action == None:
- sys.stderr.write("No action specified.\n");
- sys.exit(2);
+ utils.fubar("No action specified.");
# Safety/Sanity check
if action == "set" and suite != "testing":
- sys.stderr.write("Will not reset a suite other than testing...\n");
- sys.exit(2);
+ utils.fubar("Will not reset a suite other than testing.");
if action == "list":
get_list(suite_id);
# 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.11 2001-05-03 06:52:03 ajt Exp $
+# $Id: jenna,v 1.12 2001-06-22 22:53:14 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
else:
filename = path + filename;
if sources.has_key(source):
- sys.stderr.write("E: %s in %s / %s / source is duplicated. Gravity wins!\n" % (source, suite, component));
+ utils.warn("%s in %s / %s / source is duplicated." % (source, suite, component));
else:
sources[source] = filename;
else:
filename = path + filename;
if packages.has_key(package):
- sys.stderr.write("E: %s in %s / %s / %s / %s is duplicated. Gravity wins!" % (package, suite, component, architecture, type));
+ utils.warn("%s in %s / %s / %s / %s is duplicated." % (package, suite, component, architecture, type));
else:
packages[package] = filename;
# Installs Debian packaes
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: katie,v 1.46 2001-06-21 18:19:09 troup Exp $
+# $Id: katie,v 1.47 2001-06-22 22:53:14 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
try:
utils.move (changes_filename, Cnf["Dir::IncomingDir"] + 'DONE/' + os.path.basename(changes_filename))
except:
- sys.stderr.write("W: couldn't move changes file '%s' to DONE directory [Got %s].\n" % (os.path.basename(changes_filename), sys.exc_type));
+ utils.warn("couldn't move changes file '%s' to DONE directory. [Got %s]" % (os.path.basename(changes_filename), sys.exc_type));
install_count = install_count + 1;
q = projectB.query("SELECT id FROM source WHERE source = '%s' AND version = '%s'" % (package, version))
ql = q.getresult()
if ql == []:
- sys.stderr.write("INTERNAL ERROR: couldn't find '%s' (%s) in source table.\n" % (package, version));
- sys.exit(1);
+ utils.fubar("[INTERNAL ERROR] couldn't find '%s' (%s) in source table." % (package, version));
source_id = ql[0][0];
suite_id = db_access.get_suite_id('proposed-updates');
projectB.query("DELETE FROM src_associations WHERE suite = '%s' AND source = '%s'" % (suite_id, source_id));
q = projectB.query("SELECT b.id FROM binaries b, architecture a WHERE b.package = '%s' AND b.version = '%s' AND (a.arch_string = '%s' OR a.arch_string = 'all') AND b.architecture = a.id" % (package, version, architecture))
ql = q.getresult()
if ql == []:
- sys.stderr.write("INTERNAL ERROR: couldn't find '%s' (%s for %s architecture) in binaries table.\n" % (package, version, architecture));
- sys.exit(1);
+ utils.fubar("[INTERNAL ERROR] couldn't find '%s' (%s for %s architecture) in binaries table." % (package, version, architecture));
binary_id = ql[0][0];
suite_id = db_access.get_suite_id('proposed-updates');
projectB.query("DELETE FROM bin_associations WHERE suite = '%s' AND bin = '%s'" % (suite_id, binary_id));
try:
utils.move (changes_filename, "%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], base_changes_filename));
except:
- sys.stderr.write("W: couldn't reject changes file '%s' [Got %s].\n" % (base_changes_filename, sys.exc_type));
+ utils.warn("couldn't reject changes file '%s'. [Got %s]" % (base_changes_filename, sys.exc_type));
pass;
for file in files.keys():
if os.path.exists(file):
try:
utils.move (file, "%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], file));
except:
- sys.stderr.write("W: couldn't reject file '%s' [Got %s].\n" % (file, sys.exc_type));
+ utils.warn("couldn't reject file '%s'. [Got %s]" % (file, sys.exc_type));
pass;
# If this is not a manual rejection generate the .reason file and rejection mail message
if manual_reject_message == "":
result = os.system("vi +6 %s" % (reject_filename))
if result != 0:
- sys.stderr.write ("vi invocation failed for `%s'!\n" % (reject_filename))
- sys.exit(result)
+ utils.fubar("vi invocation failed for `%s'!" % (reject_filename), result);
# Then process it as if it were an automatic rejection
reject (changes_filename, reject_filename)
# Check that we aren't going to clash with the daily cron job
if os.path.exists("%s/Archive_Maintenance_In_Progress" % (Cnf["Dir::RootDir"])) and not Cnf["Dinstall::Options::No-Lock"]:
- sys.stderr.write("Archive maintenance in progress. Try again later.\n");
- sys.exit(2);
+ utils.fubar("Archive maintenance in progress. Try again later.");
# Obtain lock if not in no-action mode
Subst = {}
Subst["__ADMIN_ADDRESS__"] = Cnf["Dinstall::MyAdminAddress"];
Subst["__BUG_SERVER__"] = Cnf["Dinstall::BugServer"];
- bcc = "X-Katie: $Revision: 1.46 $"
+ bcc = "X-Katie: $Revision: 1.47 $"
if Cnf.has_key("Dinstall::Bcc"):
Subst["__BCC__"] = bcc + "\nBcc: %s" % (Cnf["Dinstall::Bcc"]);
else:
# General purpose archive tool for ftpmaster
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: melanie,v 1.13 2001-04-13 20:13:30 troup Exp $
+# $Id: melanie,v 1.14 2001-06-22 22:53:14 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
source = re_strip_source_version.sub('', source);
if source_packages.has_key(source):
to_remove.append(i[2:]);
- #else:
- #sys.stderr.write("W: skipping '%s' as it's source ('%s') isn't one of the source packages.\n" % (filename, source));
print "done."
# If we don't have a reason; spawn an editor so the user can add one
else:
bcc = "Bcc: " + bcc;
Subst["__BCC__"] = bcc[:-2];
- Subst["__CC__"] = "X-Melanie: $Revision: 1.13 $\n" + carbon_copy[:-1];
+ Subst["__CC__"] = "X-Melanie: $Revision: 1.14 $\n" + carbon_copy[:-1];
Subst["__SUITE_LIST__"] = suites_list;
Subst["__SUMMARY__"] = summary;
Subst["__ADMIN_ADDRESS__"] = Cnf["Dinstall::MyAdminAddress"];
# Manipulate override files
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: natalie.py,v 1.5 2001-04-13 20:13:36 troup Exp $
+# $Id: natalie.py,v 1.6 2001-06-22 22:53:14 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
type_id = db_access.get_override_type_id(type);
if type_id == -1:
- utils.fubar("Type '%s' not recognised. (Valid types are deb, udeb and dsc.)\n" % (type));
+ utils.fubar("Type '%s' not recognised. (Valid types are deb, udeb and dsc)" % (type));
if type == "dsc":
q = projectB.query("SELECT o.package, s.section, o.maintainer FROM override o, section s WHERE o.suite = %s AND o.component = %s AND o.type = %s AND o.section = s.id ORDER BY s.section, o.package" % (suite_id, component_id, type_id));
# Populate the DB
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: neve,v 1.3 2001-03-20 00:28:11 troup Exp $
+# $Id: neve,v 1.4 2001-06-22 22:53:14 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
sources = location + prefix + 'Sources.gz';
(result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (sources, temp_filename));
if (result != 0):
- sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output));
- sys.exit(result);
+ utils.fubar("Gunzip invocation failed!\n%s" % (output), result);
print 'Processing '+sources+'...';
process_sources (location, temp_filename, suite, component, server);
os.unlink(temp_filename);
# prefix = component + '/'
# do_sources(location, prefix);
else:
- sys.stderr.write("Unknown location type ('%s').\n" % (type));
- sys.exit(2);
+ utils.fubar("Unknown location type ('%s')." % (type));
# Process Packages files to populate `binaries' and friends
(result, output) = commands.getstatusoutput("psql projectb < add_constraints.sql");
print output
if (result != 0):
- sys.stderr.write("psql invocation failed!\n");
- sys.exit(result);
+ utils.fubar("psql invocation failed!\n%s" % (output), result);
return;
# rhona, cleans up unassociated binary and source packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: rhona,v 1.14 2001-05-31 02:19:30 troup Exp $
+# $Id: rhona,v 1.15 2001-06-22 22:53:14 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
Cnf = None
now_date = None; # mark newly "deleted" things as deleted "now"
delete_date = None; # delete things marked "deleted" earler than this
-overrides = {};
tried_too_hard_exc = "Tried too hard to find a free filename for %s; something's gone Pete Tong";
print "Checking for orphaned source packages..."
- # Get the list of source packages not in a suite and not linked to
- # by any binary packages.
+ # Get the list of source packages not in a suite.
q = projectB.query("""
SELECT s.id, s.file FROM source s
for i in q.getresult():
filename = i[0] + i[1];
if not os.path.exists(filename):
- sys.stderr.write("E: can not find %s.\n" % (filename));
+ utils.warn("can not find '%s'." % (filename));
continue;
if os.path.isfile(filename):
if os.path.islink(filename):
else:
utils.move(filename, dest_filename);
else:
- sys.stderr.write("%s is neither symlink nor file?!\n" % (filename));
- sys.exit(1);
+ utils.fubar("%s is neither symlink nor file?!" % (filename));
# Delete from the 'files' table
if not Cnf["Rhona::Options::No-Action"]:
print "rhona version 0.0000000000";
usage(0);
- override_filename = Cnf["Dir::OverrideDir"] + Cnf["Rhona::OverrideFilename"];
- if not os.access(override_filename, os.R_OK):
- sys.stderr.write("W: Could not find source-only override file '%s'.\n" % (override_filename));
-
now_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()));
delete_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()-int(Cnf["Rhona::StayOfExecution"])));
# Sanity check the database
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: tea,v 1.10 2001-03-24 03:30:35 troup Exp $
+# $Id: tea,v 1.11 2001-06-22 22:53:14 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
filename = os.path.abspath(i[0] + i[1]);
db_files[filename] = "";
if os.access(filename, os.R_OK) == 0:
- sys.stderr.write("W: '%s' doesn't exist.\n" % (filename));
+ utils.warn("'%s' doesn't exist." % (filename));
file = utils.open_file(Cnf["Dir::OverrideDir"]+'override.unreferenced','r');
for filename in file.readlines():
try:
utils.parse_changes(file, 1);
except utils.invalid_dsc_format_exc, line:
- sys.stderr.write("E: syntax error in .dsc file '%s', line %s.\n" % (file, line));
+ utils.warn("syntax error in .dsc file '%s', line %s." % (file, line));
count = count + 1;
if count:
- sys.stderr.write("Found %s invalid .dsc files.\n" % (count));
+ utils.warn("Found %s invalid .dsc files." % (count));
################################################################################
try:
file = utils.open_file(filename, 'r');
except:
- sys.stderr.write("E: can't open '%s'.\n" % (filename));
+ utils.warn("can't open '%s'." % (filename));
continue;
md5sum = apt_pkg.md5sum(file);
size = os.stat(filename)[stat.ST_SIZE];
if md5sum != db_md5sum:
- sys.stderr.write("E: **WARNING** md5sum mismatch for '%s' ('%s' [current] vs. '%s' [db]).\n" % (filename, md5sum, db_md5sum));
+ utils.warn("**WARNING** md5sum mismatch for '%s' ('%s' [current] vs. '%s' [db])." % (filename, md5sum, db_md5sum));
if size != db_size:
- sys.stderr.write("E: **WARNING** size mismatch for '%s' ('%s' [current] vs. '%s' [db]).\n" % (filename, size, db_size));
+ utils.warn("**WARNING** size mismatch for '%s' ('%s' [current] vs. '%s' [db])." % (filename, size, db_size));
print "Done."