X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=charisma;h=04ef3ecb9b5eac91164d53a43afb1108ac224d9e;hb=a29673e49824a6c0838df50ab64ac08cf32852d8;hp=c88fa52559633e588458cb6c343511300010ba1b;hpb=2f5e692bfbbb6f8146f50d944f7fcc169a95a0a3;p=dak.git diff --git a/charisma b/charisma index c88fa525..04ef3ecb 100755 --- a/charisma +++ b/charisma @@ -1,8 +1,8 @@ #!/usr/bin/env python # Generate Maintainers file used by e.g. the Debian Bug Tracking System -# Copyright (C) 2000, 2001 James Troup -# $Id: charisma,v 1.12 2001-11-18 19:57:58 rmurray Exp $ +# Copyright (C) 2000, 2001, 2002, 2003 James Troup +# $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 @@ -26,9 +26,9 @@ ################################################################################ -import os, pg, re, string, sys -import db_access, utils -import apt_pkg +import pg, sys; +import db_access, utils; +import apt_pkg; ################################################################################ @@ -92,7 +92,7 @@ def main(): 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 @@ -132,16 +132,14 @@ def main(): 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 = '*'; @@ -154,7 +152,7 @@ def main(): 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"]); ################################################################################