aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-11-16 08:56:36 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2007-11-16 08:56:36 +0000
commit1d8855a956572c444a9386ae6b2448c089b587a8 (patch)
tree10f2598516b033a5cd21d0dcb29ddeee6ad782b2 /web
parentAdd robots.txt (diff)
downloadpackages-1d8855a956572c444a9386ae6b2448c089b587a8.tar.gz
packages-1d8855a956572c444a9386ae6b2448c089b587a8.tar.bz2
packages-1d8855a956572c444a9386ae6b2448c089b587a8.zip
If the atom has no version, we need to collapse differently.
Diffstat (limited to 'web')
-rw-r--r--web/lib/changelog_formatter.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/lib/changelog_formatter.py b/web/lib/changelog_formatter.py
index aca1f62..09c2f12 100644
--- a/web/lib/changelog_formatter.py
+++ b/web/lib/changelog_formatter.py
@@ -176,9 +176,13 @@ def optimal_collapse(atom, pnlength, pvlength, ellipsis = '^'):
maxlength = pnlength + pvlength + 1
npn = pn = atom.package
npv = pv = atom.fullver
+ sep = '-'
+ if atom.fullver is None:
+ npv = pv = ''
+ sep = ''
tlpn = len(pn)
tlpv = len(pv)
- pnpv = "%s-%s" % (npn, npv)
+ pnpv = "%s%s%s" % (npn, sep, npv)
i = 0
while len(pnpv) > maxlength and i < 25:
if tlpv > pvlength:
@@ -187,7 +191,7 @@ def optimal_collapse(atom, pnlength, pvlength, ellipsis = '^'):
elif tlpn > pnlength:
tlpn -= 1
npn = pn[0:tlpn-1] + '@'
- pnpv = "%s-%s" % (npn, npv)
+ pnpv = "%s%s%s" % (npn, sep, npv)
i += 1
return pnpv.replace('@', ellipsis)