[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.2-99-g5f0f895



The following commit has been merged in the master branch:
commit 5f0f89527471f352c0e11bca510c8c0d2dd24f18
Author: Jakub Wilk <jwilk@debian.org>
Date:   Mon Sep 5 15:25:00 2011 +0200

    refresh-manual-refs: Strip some HTML and treat newlines as space
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index b3682bd..ff7c805 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -195,6 +195,9 @@ lintian (2.5.3) UNRELEASED; urgency=low
     + [NT] Remove code to refresh refs to the Library Packaging
       Guide.
     + [JW] Added the java-policy and fixed the lintian ref.
+    + [JW] Don't strip newlines from titles, but treat them as regular
+      whitespace characters.
+    + [JW] Strip some superfluous HTML markup from titles.
 
   * reporting/{config,html_reports,templates/foot.tmpl}:
     + [NT] Added a link to the Lintian source code.
diff --git a/private/refresh-manual-refs b/private/refresh-manual-refs
index 023d516..79ccf8c 100755
--- a/private/refresh-manual-refs
+++ b/private/refresh-manual-refs
@@ -59,6 +59,8 @@ my $title_re = qr/<title\s?>(.+?)<\/title\s?>/i;
 my $link_re = qr/<link href="(.+?)" rel="[\w]+" title="([A-Z]|[A-Z]?[\d\.]+?)\.?\s+([\w\s[:punct:]]+?)">/;
 my $index_re = qr/<a href="(.+?)">([A-Z]|[A-Z]?[\d\.]+?)\.?\s+([\w\s[:punct:]]+?)<\/a>/;
 my $fields = [ [ 'url' ], [ 'section' ], [ 'title' ] ];
+my $dbk_index_re = qr/([\d.]+?)\.\s+<a\s*href="(.+?)"\s*>([\w\s[:punct:]]+?)<\/a\s*>/i;
+my $dbk_fields = [ [ 'section' ], [ 'url' ], [ 'title' ] ];
 
 my %manuals = (
     'policy' => [
@@ -84,14 +86,12 @@ my %manuals = (
     'java-policy' => [
         '/usr/share/doc/java-common/debian-java-policy/index.html',
         'http://www.debian.org/doc/packaging-manuals/java-policy/',
-        qr/([\d.]+?)\.\s+<a\s*href="(.+?)"\s*>([\w\s[:punct:]]+?)<\/a\s*>/i,
-        [ [ 'section' ], [ 'url' ], [ 'title' ] ]
+        $dbk_index_re, $dbk_fields
     ],
     'lintian' => [
         '/usr/share/doc/lintian/lintian.html/index.html',
         'http://lintian.debian.org/manual/',
-        qr/([\d.]+?)\.\s+<a\s*href="(.+?)"\s*>([\w\s[:punct:]]+?)<\/a\s*>/i,
-        [ [ 'section' ], [ 'url' ], [ 'title' ] ]
+        $dbk_index_re, $dbk_fields
     ],
     'devref' => [
         '/usr/share/doc/developers-reference/index.html',
@@ -165,8 +165,9 @@ sub extract_refs {
             }
 
             $ref{section} =~ s/^\#(.+)$/\L$1/;
-            $ref{title} =~ s/\n//g;
             $ref{title} =~ s/\s+/ /g;
+            $ref{title} =~ s,<span[^>]*>(.*?)</span ?>,$1,ig;
+            $ref{title} =~ s,<code[^>]*>(.*?)</code ?>,<code>$1</code>,ig;
             $ref{url} = "$url$ref{url}";
             $ref{url} = '' if not $url;
 

-- 
Debian package checker


Reply to: