#!/usr/bin/env python
# Generate Maintainers file used by e.g. the Debian Bug Tracking System
-# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
-# $Id: charisma,v 1.14 2002-05-03 16:06:45 troup Exp $
+# Copyright (C) 2000, 2001, 2002, 2003 James Troup <james@nocrew.org>
+# $Id: charisma,v 1.16 2003-04-15 16:03:31 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, string, sys;
+import pg, sys;
import db_access, utils;
import apt_pkg;
db_access.init(Cnf, projectB);
for suite in Cnf.SubTree("Suite").List():
- suite = string.lower(suite);
+ suite = suite.lower();
suite_priority = int(Cnf["Suite::%s::Priority" % (suite)]);
# Source packages
for filename in extra_files:
file = utils.open_file(filename);
for line in file.readlines():
- line = string.strip(utils.re_comments.sub('', line[:-1]))
+ line = utils.re_comments.sub('', line).strip();
if line == "":
continue;
- split = string.split(line);
+ split = line.split();
lhs = split[0];
- maintainer = fix_maintainer(string.join(split[1:]));
- if string.find(lhs,'~') != -1:
- lhs_split = string.split(lhs, '~');
- package = lhs_split[0];
- version = lhs_split[1];
+ maintainer = fix_maintainer(" ".join(split[1:]));
+ if lhs.find('~') != -1:
+ (package, version) = lhs.split('~');
else:
package = lhs;
version = '*';
package_keys = packages.keys()
package_keys.sort()
for package in package_keys:
- lhs = string.join([package, packages[package]["version"]], '~');
+ lhs = "~".join([package, packages[package]["version"]]);
print "%-30s %s" % (lhs, packages[package]["maintainer"]);
################################################################################