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

Bug#640371: [checks/files] check for compliance with Packaging Policy for Vim 3.1



Package: lintian
Version: 2.5.2
Severity: wishlist
Tags: patch

Please see the attached patches. (The first two merely clean up a few things in private/refresh-manual-refs.)

Vim maintainers cc-ed, so that they can comment.

--
Jakub Wilk
diff --git a/private/refresh-manual-refs b/private/refresh-manual-refs
--- a/private/refresh-manual-refs
+++ b/private/refresh-manual-refs
@@ -59,6 +59,8 @@
 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 @@
     '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',
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -195,6 +195,9 @@
     + [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
--- a/private/refresh-manual-refs
+++ b/private/refresh-manual-refs
@@ -165,8 +165,9 @@
             }
 
             $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;
 
diff --git a/checks/files b/checks/files
--- a/checks/files
+++ b/checks/files
@@ -562,6 +562,13 @@
 	elsif ($file =~ m,^usr/share/mime/[^/]+$,) {
 	    tag 'package-contains-mime-cache-file', $file;
 	}
+	# ---------------- /usr/share/vim
+	elsif ($file =~ m,^usr/share/vim/vim(?:current|\d{2})/([^/]++),) {
+	    my $is_vimhelp = $1 eq 'doc' && $pkg =~ m,^vimhelp-\w++$,;
+	    my $is_vim = $source_pkg =~ m,vim,;
+	    tag 'vim-addon-within-vim-runtime-path', $file
+		unless $is_vim or $is_vimhelp;
+	}
 	# ---------------- /usr/share
 	elsif ($file =~ m,^usr/share/[^/]+$,) {
 	    if ($index_info->{type} =~ m/^[-h]/) {
diff --git a/checks/files.desc b/checks/files.desc
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -1288,3 +1288,10 @@
  is a chance that the package is missing files.
 Ref: policy 5.6.8
 
+Tag: vim-addon-within-vim-runtime-path
+Severity: normal
+Certainty: certain
+Info: Vim addons should not be installed directly under a directory contained
+ in the Vim runtime path.  Users shall be given the freedom to choose which
+ addons they want to have enabled and which they don't.
+Ref: vim-policy 3.1
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,7 @@
       - unknown-paragraph-in-dep5-copyright
       - unused-license-paragraph-in-dep5-copyright
       - unversioned-copyright-format-uri
+      - vim-addon-within-vim-runtime-path
       - wiki-copyright-format-uri
     + Removed:
       - debian-changelog-file-contains-debmake-default-email-address
@@ -87,6 +88,8 @@
       from python{,3}-{stdlib-extensions,profiler,old-doctools} sources.
       Add reference to Python Policy in the tag description.
       (Closes: #640211)
+    + [JW] Add check for Vim addons installing files into a directory within
+      Vim runtime path.
   * checks/menus.desc:
     + [NT] Added reference to the doc-base manual to help people
       find the list of valid doc-base sections.  (Closes: #584280)
diff --git a/private/refresh-manual-refs b/private/refresh-manual-refs
--- a/private/refresh-manual-refs
+++ b/private/refresh-manual-refs
@@ -88,6 +88,11 @@
         'http://www.debian.org/doc/packaging-manuals/java-policy/',
         $dbk_index_re, $dbk_fields
     ],
+    'vim-policy' => [
+        '/usr/share/doc/vim-doc/vim-policy.html/index.html',
+        'http://pkg-vim.alioth.debian.org/vim-policy.html/',
+        $dbk_index_re, $dbk_fields
+    ],
     'lintian' => [
         '/usr/share/doc/lintian/lintian.html/index.html',
         'http://lintian.debian.org/manual/',

Reply to: