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

Bug#379749: trailing spaces not handled correctly in doc-base checks



Package: lintian
Version: 1.23.22
Severity: normal

Tailing spaces in doc-base files are not matches correctly in
/usr/share/lintian/checks/menus
I noticed this, because freesci-doc started failing lintian checks
with this warning:
  W: freesci-doc: doc-base-file-unknown-format freesci-doc:15 text
even though the doc-base file in the apckages looked fine.

Upon debugging, it turned out the Format field in freesci-doc's
doc-base file had trailing spaces, which lintian included in the
format, causing it to try and match "text   " to the known formats.

The following patch fixes this (* is greedy, so the .* will match the
maximum number of chars, including trailing spaces).

--- /usr/share/lintian/checks/menus     2006-05-09 03:53:09.000000000 +0200
+++ menus       2006-07-25 13:31:41.968334438 +0200
@@ -209,10 +209,10 @@
            if (/^\s/ && $field) {
                push (@files, split ' ');
            }
-           if (/^(Index|Files)\s*:\s*(.*)\s*$/i) {
+           if (/^(Index|Files)\s*:\s*(.*?)\s*$/i) {
                $field = lc $1;
                @files = split (' ', $2);
-           } elsif (/^Format\s*:\s*(.*)\s*$/i) {
+           } elsif (/^Format\s*:\s*(.*?)\s*$/i) {
                my $format = lc $1;
                tag "doc-base-file-unknown-format", "$dbfile:$.", $format
                    unless $known_doc_base_formats{$format};


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17.4
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages lintian depends on:
ii  binutils                 2.17-1          The GNU assembler, linker and bina
ii  diffstat                 1.43-1          produces graph of changes introduc
ii  dpkg-dev                 1.13.22         package building tools for Debian
ii  file                     4.17-2          Determines file type using "magic"
ii  gettext                  0.14.6-1        GNU Internationalization utilities
ii  intltool-debian          0.35.0+20060710 Help i18n of RFC822 compliant conf
ii  libparse-debianchangelog 1.0-1           parse Debian changelogs and output
ii  man-db                   2.4.3-3         The on-line manual pager
ii  perl [libdigest-md5-perl 5.8.8-6         Larry Wall's Practical Extraction 

lintian recommends no packages.

-- no debconf information



Reply to: