# Script to automate some parts of checking NEW packages
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
-# $Id: fernanda.py,v 1.2 2002-05-03 16:06:45 troup Exp $
+# $Id: fernanda.py,v 1.3 2002-05-18 23:54:51 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
def check_changes (changes_filename):
display_changes(changes_filename);
- changes = utils.parse_changes (changes_filename, 0);
- files = utils.build_file_list(changes, "");
+ changes = utils.parse_changes (changes_filename);
+ files = utils.build_file_list(changes);
for file in files.keys():
if file[-4:] == ".deb" or file[-5:] == ".udeb":
check_deb(file);
# Remove obsolete .changes files from proposed-updates
# Copyright (C) 2001, 2002 James Troup <james@nocrew.org>
-# $Id: halle,v 1.6 2002-05-08 11:13:02 troup Exp $
+# $Id: halle,v 1.7 2002-05-18 23:54:51 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
def check_changes (filename):
try:
- changes = utils.parse_changes(filename, 0)
- files = utils.build_file_list(changes, "");
+ changes = utils.parse_changes(filename);
+ files = utils.build_file_list(changes);
except:
utils.warn("Couldn't read changes file '%s'." % (filename));
return;
# Checks Debian packages from Incoming
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
-# $Id: jennifer,v 1.19 2002-05-14 22:28:01 troup Exp $
+# $Id: jennifer,v 1.20 2002-05-18 23:54:51 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
################################################################################
# Globals
-jennifer_version = "$Revision: 1.19 $";
+jennifer_version = "$Revision: 1.20 $";
Cnf = None;
Options = None;
# Parse the .changes field into a dictionary
try:
- changes.update(utils.parse_changes(filename, 0));
+ changes.update(utils.parse_changes(filename));
except utils.cant_open_exc:
reject("can't read changes file '%s'." % (filename));
return 0;
# Parse the Files field from the .changes into another dictionary
try:
- files.update(utils.build_file_list(changes, ""));
+ files.update(utils.build_file_list(changes));
except utils.changes_parse_error_exc, line:
reject("error parsing changes file '%s', can't grok: %s." % (filename, line));
except utils.nk_format_exc, format:
if files[file]["type"] == "dsc":
# Parse the .dsc file
try:
- dsc.update(utils.parse_changes(file, 1));
+ dsc.update(utils.parse_changes(file, dsc_whitespace_rules=1));
except utils.cant_open_exc:
# if not -n copy_to_holding() will have done this for us...
if Options["No-Action"]:
reject("syntax error in .dsc file '%s', line %s." % (file, line));
# Build up the file list of files mentioned by the .dsc
try:
- dsc_files.update(utils.build_file_list(dsc, 1));
+ dsc_files.update(utils.build_file_list(dsc, is_a_dsc=1));
except utils.no_files_exc:
reject("no Files: field in .dsc file.");
continue;
# Dependency check proposed-updates
# Copyright (C) 2001, 2002 James Troup <james@nocrew.org>
-# $Id: jeri,v 1.6 2002-05-14 15:34:02 troup Exp $
+# $Id: jeri,v 1.7 2002-05-18 23:54:51 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
def check_changes (filename):
try:
- changes = utils.parse_changes(filename, 0)
- files = utils.build_file_list(changes, "");
+ changes = utils.parse_changes(filename);
+ files = utils.build_file_list(changes);
except:
utils.warn("Error parsing changes file '%s'" % (filename));
return;
# General purpose package removal tool for ftpmaster
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
-# $Id: melanie,v 1.25 2002-05-16 18:01:33 rmurray Exp $
+# $Id: melanie,v 1.26 2002-05-18 23:54:51 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 i in source_packages.keys():
filename = string.join(source_packages[i], '/');
try:
- dsc = utils.parse_changes(filename, 0);
+ dsc = utils.parse_changes(filename);
except utils.cant_open_exc:
utils.warn("couldn't open '%s'." % (filename));
continue;
Subst["__BCC__"] = "Bcc: " + string.join(bcc, ", ");
else:
Subst["__BCC__"] = "X-Filler: 42";
- Subst["__CC__"] = "X-Melanie: $Revision: 1.25 $";
+ Subst["__CC__"] = "X-Melanie: $Revision: 1.26 $";
if carbon_copy:
Subst["__CC__"] = Subst["__CC__"] + "\nCc: " + string.join(carbon_copy, ", ");
Subst["__SUITE_LIST__"] = suites_list;
# Clean incoming of old unused files
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
-# $Id: shania,v 1.14 2002-05-08 11:13:02 troup Exp $
+# $Id: shania,v 1.15 2002-05-18 23:54:51 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
# Proces all .changes and .dsc files.
for changes_filename in changes_files:
try:
- changes = utils.parse_changes(changes_filename, 0)
- files = utils.build_file_list(changes, "");
+ changes = utils.parse_changes(changes_filename);
+ files = utils.build_file_list(changes);
except:
utils.warn("error processing '%s'; skipping it. [Got %s]" % (changes_filename, sys.exc_type));
continue;
for file in files.keys():
if file[-4:] == ".dsc":
try:
- dsc = utils.parse_changes(file, 0)
- dsc_files = utils.build_file_list(dsc, 1)
+ dsc = utils.parse_changes(file);
+ dsc_files = utils.build_file_list(dsc, is_a_dsc=1);
except:
utils.warn("error processing '%s'; skipping it. [Got %s]" % (file, sys.exc_type));
continue;
# Utility functions
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
-# $Id: utils.py,v 1.43 2002-05-10 00:24:14 troup Exp $
+# $Id: utils.py,v 1.44 2002-05-18 23:54:51 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
-import commands, os, pwd, re, socket, shutil, string, sys, tempfile
+import os, pwd, re, socket, shutil, string, sys, tempfile
import apt_pkg
re_comments = re.compile(r"\#.*")
# o The data section must end with a blank line and must be followed by
# "-----BEGIN PGP SIGNATURE-----".
-def parse_changes(filename, dsc_whitespace_rules):
+def parse_changes(filename, dsc_whitespace_rules=0):
changes_in = open_file(filename);
error = "";
changes = {};
# Dropped support for 1.4 and ``buggy dchanges 3.4'' (?!) compared to di.pl
-def build_file_list(changes, dsc):
+def build_file_list(changes, is_a_dsc=0):
files = {}
format = changes.get("format", "")
if format != "":
format = float(format)
- if dsc == "" and (format < 1.5 or format > 2.0):
+ if not is_a_dsc and (format < 1.5 or format > 2.0):
raise nk_format_exc, format;
# No really, this has happened. Think 0 length .dsc file.
s = string.split(i)
section = priority = "";
try:
- if dsc != "":
+ if is_a_dsc:
(md5, size, name) = s
else:
(md5, size, section, priority, name) = s
# Sort by source name, source version, 'have source', and then by filename
def changes_compare (a, b):
try:
- a_changes = parse_changes(a, 0)
+ a_changes = parse_changes(a);
except:
return -1;
try:
- b_changes = parse_changes(b, 0)
+ b_changes = parse_changes(b);
except:
return 1;
b_version = b_changes.get("version");
q = apt_pkg.VersionCompare(a_version, b_version);
if q:
- return q
+ return q;
# Sort by 'have source'
- a_has_source = a_changes["architecture"].get("source")
- b_has_source = b_changes["architecture"].get("source")
+ a_has_source = a_changes["architecture"].get("source");
+ b_has_source = b_changes["architecture"].get("source");
if a_has_source and not b_has_source:
return -1;
elif b_has_source and not a_has_source: