This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch master
in repository libparse-debianchangelog-perl.

commit 26beeef7af8066a868ca283c53f4157197b0315f
Author: Frank Lichtenheld <fr...@lichtenheld.de>
Date:   Mon Apr 4 17:20:14 2011 +0200

    http_ftp_urls: Fix conversion of <http://something/>
    
    Combines some nifty pieces of regex magic.
---
 Changes                                     |  7 +++++++
 lib/Parse/DebianChangelog/ChangesFilters.pm |  4 ++--
 t/Parse-DebianChangelog-ChangesFilters.t    | 16 +++++++---------
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/Changes b/Changes
index 0c11552..4b5bbf0 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,10 @@
+Parse-DebianChangelog (1.2.0) unstable; urgency=low
+
+  * ChangelogFilters:
+    - Fix conversion of <http://something/> (Closes: #603341)
+
+ -- Frank Lichtenheld <fr...@lichtenheld.de>  Mon, 04 Apr 2011 16:43:54 +0200
+
 Parse-DebianChangelog (1.1.1) unstable; urgency=low
 
   * Bug fixes:
diff --git a/lib/Parse/DebianChangelog/ChangesFilters.pm 
b/lib/Parse/DebianChangelog/ChangesFilters.pm
index 9af527a..1309124 100644
--- a/lib/Parse/DebianChangelog/ChangesFilters.pm
+++ b/lib/Parse/DebianChangelog/ChangesFilters.pm
@@ -73,8 +73,8 @@ sub http_ftp_urls {
     $text=~ s|&lt;URL:([-\w\.\/:~_\@]+):([a-zA-Z0-9\'() ]+)&gt;
         |$cgi->a({ -href=>$1 }, $2)
        |xego;
-    $text=~ s|https?:[\w/\.:\@+\-~\%\#?=&;,]+[\w/]
-       |$cgi->a({ -href=>$& }, $&)
+    $text=~ s|(&lt;)?\K(https?:[\w/\.:\@+\-~\%\#?=&;,]+[\w/])(?(1)(?=&gt;))
+       |$cgi->a({ -href=>$2 }, $2)
        |xego;
     $text=~ s|ftp:[\w/\.:\@+\-~\%\#?=&;,]+[\w/]
        |$cgi->a({ -href=>$& }, $&)
diff --git a/t/Parse-DebianChangelog-ChangesFilters.t 
b/t/Parse-DebianChangelog-ChangesFilters.t
index 2c6c086..071fba9 100644
--- a/t/Parse-DebianChangelog-ChangesFilters.t
+++ b/t/Parse-DebianChangelog-ChangesFilters.t
@@ -33,16 +33,12 @@ is( $text,
     'foo <a 
href="http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar";>http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar</a>
 bar',
     'http_ftp_urls' );
 
-TODO: {
-    local $TODO = 'bug in detection code';
-
-    $text = http_ftp_urls( 'foo 
&lt;http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar&gt; bar',
-                          $cgi );
+$text = http_ftp_urls( 'foo 
&lt;http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar&gt; bar',
+                      $cgi );
 
-    is( $text,
-       'foo &lt;<a 
href="http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar";>http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar</a>&gt;
 bar',
-       'http_ftp_urls with complicated embedding' );
-}
+is( $text,
+    'foo &lt;<a 
href="http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar";>http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar</a>&gt;
 bar',
+    'http_ftp_urls with complicated embedding' );
 
 $text = email_to_ddpo( 'Frank Lichtenheld &lt;dj...@debian.org&gt;', $cgi );
 
@@ -81,6 +77,7 @@ is( $text,
 my $complete_text = <<'EOT';
 hällö & tschüß <tt id="a">:)</tt>
 foo http://foo.com/cgi-bin/t.cgi?id=bar&name=bar bar
+foo <http://foo.com/cgi-bin/t.cgi?id=bar&name=bar> bar
 Frank Lichtenheld <dj...@debian.org>
 This (Closes: #123456, Bug#4321, #222) (hopefully, maybe closes #72345, too)
 SECURITY FIXES (CAN-2005-9999, CVE-2004-9999):
@@ -92,6 +89,7 @@ EOT
 my $complete_result = <<'EOR';
 hällö &amp; tschüß &lt;tt id=&quot;a&quot;&gt;:)&lt;/tt&gt;
 foo <a 
href="http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar";>http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar</a>
 bar
+foo &lt;<a 
href="http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar";>http://foo.com/cgi-bin/t.cgi?id=bar&amp;name=bar</a>&gt;
 bar
 Frank Lichtenheld &lt;<a 
href="http://qa.debian.org/developer.php?login=dj...@debian.org";>dj...@debian.org</a>&gt;
 This (Closes: <a class="buglink" 
href="http://bugs.debian.org/123456";>#123456</a>, <a class="buglink" 
href="http://bugs.debian.org/4321";>Bug#4321</a>, <a class="buglink" 
href="http://bugs.debian.org/222";>#222</a>) (hopefully, maybe closes #72345, 
too)
 SECURITY FIXES (<a 
href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-9999";>CAN-2005-9999</a>,
 <a 
href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-9999";>CVE-2004-9999</a>):

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/libparse-debianchangelog-perl.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to