X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=inline;f=utils.py;h=3d83da0193fd4d2a5fa90753047de376ab32f7d9;hb=bc42cb4cc69e8cd2bca50cf26e786d04492966af;hp=0dea7de1a792ea84d74f1a3e384f2cb080912c06;hpb=5b97c377b7a99036397a7815ed60a3058e2eb875;p=dak.git diff --git a/utils.py b/utils.py index 0dea7de1..3d83da01 100644 --- a/utils.py +++ b/utils.py @@ -2,7 +2,7 @@ # Utility functions # Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup -# $Id: utils.py,v 1.67 2004-04-07 14:23:30 dsilvers Exp $ +# $Id: utils.py,v 1.69 2004-06-24 00:41:39 troup Exp $ ################################################################################ @@ -327,10 +327,12 @@ switched to 'email (name)' format.""" if not maintainer: return ('', '', '', ''); - if maintainer.find("<") == -1 or (maintainer[0] == "<" and \ - maintainer[-1:] == ">"): + if maintainer.find("<") == -1: email = maintainer; name = ""; + elif (maintainer[0] == "<" and maintainer[-1:] == ">"): + email = maintainer[1:-1]; + name = ""; else: m = re_parse_maintainer.match(maintainer); if not m: @@ -635,6 +637,19 @@ def join_with_commas_and(list): ################################################################################ +def pp_dep (deps): + pp_deps = []; + for atom in deps: + (pkg, version, constraint) = atom; + if constraint: + pp_dep = "%s (%s %s)" % (pkg, constraint, version); + else: + pp_dep = pkg; + pp_deps.append(pp_dep); + return " |".join(pp_deps); + +################################################################################ + def get_conf(): return Cnf;