Package: apt-listchanges
Severity: wishlist
Tags: patch

Hi,

Thanks for applying the last patch so promptly. There is now only
one change in the Ubuntu package, and I think it would be useful
in Debian too, I just left it out last time as I didn't think it
through.

The following patch by Colin Watson makes LP: #1234 in to
links in the same way as for Debian bugs. I think that if
there is one of these in a Debian package adding the link
would be useful, as it would allow the user to get more
information on the bug. There are packages that are maintained
for both Debian and Ubuntu, so these links would show up in
some places.

Note that the patch tweaks the existing regex to prevent them
both triggering at the same time.

Please consider applying the patch.

Thanks,

James

diff -pruN 2.74/apt-listchanges/apt_listchanges.py
2.74ubuntu3/apt-listchanges/apt_listchanges.py
--- 2.74/apt-listchanges/apt_listchanges.py     2007-05-11 22:09:56.000000000 
+0100
+++ 2.74ubuntu3/apt-listchanges/apt_listchanges.py      2007-07-04 
03:52:19.000000000 +0100
@@ -246,7 +270,12 @@ class xterm_pager(xterm):
 class html:
     suffix = '.html'
 
-    bug_stanza_re = 
re.compile(r'(?:closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*|#\d+)', 
re.I)
+    # LP bug-closing format requires the colon after "LP", but many people
+    # say "LP #123456" when talking informally about bugs.
+    lp_bug_stanza_re = re.compile(r'(?:lp:?\s+\#\d+(?:,\s*\#\d+)*)', re.I)
+    lp_bug_re        = re.compile('(?P<linktext>#(?P<bugnum>\d+))', re.I)
+    lp_bug_fmt       = r'<a 
href="https://launchpad.net/bugs/\g<bugnum>">\g<linktext></a>'
+    bug_stanza_re = 
re.compile(r'(?:closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*|(?<!">)#\d+)',
 re.I)
     bug_re        = re.compile('(?P<linktext>#?(?P<bugnum>\d+))', re.I)
     bug_fmt       = r'<a 
href="http://bugs.debian.org/\g<bugnum>">\g<linktext></a>'
     # regxlib.com
@@ -275,6 +304,7 @@ class html:
                 '&', '&amp;').replace(
                 '<', '&lt;').replace(
                 '>', '&gt;')
+            line = self.lp_bug_stanza_re.sub(lambda m: 
self.lp_bug_re.sub(self.lp_bug_fmt, m.group(0)), line)
             line = self.bug_stanza_re.sub(lambda m: 
self.bug_re.sub(self.bug_fmt, m.group(0)), line)
             line = self.email_re.sub(r'<a href="mailto:\g<0>">\g<0></a>', line)
             htmltext.write(line + '\n')




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to