Package: dwww
Version: 1.13.4+nmu3
Severity: normal
Tags: patch

Dear Maintainer,

Dear Maintainer,

Trying to access a locally installed manual, I noticed it was missing from the
dwww menu. Instead, dwww listed a spurious error related to that manual,
complaining about a file with the empty string for its path. install-docs,
invoked with the -c or -i option, did not report any errors or warnings for the
respective control file.

Examination of the Perl script /usr/sbin/dwww-build-menu lead to subroutine
ParseDocBaseFile of module Debian::Dwww::DocBase (defined in file
/usr/share/perl5/Debian/Dwww/DocBase.pm). This routine is apparently expected
to parse a document control file (installed in /var/lib/doc-base/documents) and
represent its contents as a Perl object it returns.

I found this routine would not append continuation lines for headers appearing
in a format section. (Instead, the continuation lines would from a fictitious
header of that name in the main section; for example, continuation lines for
the Files header of the format sections would be concatenated to form the
content of some Files header in the main section.)

Since quite obvious, this defect was readily corrected in the installed file,
with the changes recorded in the diff file included below. Upon re-running
dwww-build-menu the missing manual documents appeared properly in the dwww
menu, as expected. I also noticed that documentation of some other package,
libxml-parser-perl in particular, also appeared after rebuilding the menu with
the patched module.

*** DocBase.pm.diff
21c21,22
<     my ($fld, $val, $lastfld) = ('', '', '');
---
>     my ($fld, $val) = ('', '');
>     my $last = undef;
37c38
<             $lastfld = '';
---
>           $last = undef;
43c44
<                     $entry->{$fld} = $val;
---
>                   ${$last = \$entry->{$fld}} = $val;
45a47
>                   $last = undef;
47c49,50
<                     $entry->{'formats'}->{$format}->{'index'} = $val;
---
>                   $last = \$entry->{formats}->{$format}->{index};
>                   $$last = $val;
49c52,53
<                     $entry->{'formats'}->{$format}->{'files'} = $val;
---
>                   $last = \$entry->{formats}->{$format}->{files};
>                   $$last = $val
53,55c57,58
<             $lastfld = $fld;
<         } elsif (/^\s+/ and $lastfld ne '') {
<             $entry->{$lastfld} .= "\n$_";
---
>         } elsif (/^\s+/ and defined($last)) {
>             $$last .= "\n$_";



-- System Information:
Debian Release: 10.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-9-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dwww depends on:
ii  apache2 [httpd-cgi]    2.4.38-3+deb10u3
ii  debconf [debconf-2.0]  1.5.71
ii  debianutils            4.8.6.1
ii  doc-base               0.10.8
ii  file                   1:5.35-4+deb10u1
ii  libc6                  2.28-10
ii  libfile-ncopy-perl     0.36-2
ii  libmime-types-perl     2.17-1
ii  man-db                 2.8.5-2
ii  mime-support           3.62
ii  perl                   5.28.1-6
ii  ucf                    3.0038+nmu1

Versions of packages dwww recommends:
ii  apache2 [httpd]  2.4.38-3+deb10u3
ii  apt              1.8.2.1
ii  dlocate          1.07+nmu1
ii  info2www         1.2.2.9-24
ii  swish++          6.1.5-5

Versions of packages dwww suggests:
ii  doc-debian                          6.4
pn  dpkg-www                            <none>
ii  firefox-esr [www-browser]           68.10.0esr-1~deb10u1
ii  google-chrome-stable [www-browser]  84.0.4147.89-1

-- debconf information:
  dwww/serverport: 80
  dwww/badport:
  dwww/nosuchdir:
  dwww/cgidir: /usr/lib/cgi-bin
  dwww/nosuchuser:
  dwww/docrootdir: /var/www
  dwww/index_docs: false
  dwww/servername: PD-T420.intra
  dwww/cgiuser: www-data
21c21,22
<     my ($fld, $val, $lastfld) = ('', '', ''); 
---
>     my ($fld, $val) = ('', ''); 
>     my $last = undef;
37c38
<             $lastfld = '';    
---
>           $last = undef;
43c44
<                     $entry->{$fld} = $val;
---
>                   ${$last = \$entry->{$fld}} = $val;
45a47
>                   $last = undef;
47c49,50
<                     $entry->{'formats'}->{$format}->{'index'} = $val;
---
>                   $last = \$entry->{formats}->{$format}->{index};
>                   $$last = $val;
49c52,53
<                     $entry->{'formats'}->{$format}->{'files'} = $val;
---
>                   $last = \$entry->{formats}->{$format}->{files};
>                   $$last = $val
53,55c57,58
<             $lastfld = $fld;
<         } elsif (/^\s+/ and $lastfld ne '') {
<             $entry->{$lastfld} .= "\n$_";
---
>         } elsif (/^\s+/ and defined($last)) {
>             $$last .= "\n$_";
21c21,22
<     my ($fld, $val, $lastfld) = ('', '', ''); 
---
>     my ($fld, $val) = ('', ''); 
>     my $last = undef;
37c38
<             $lastfld = '';    
---
>           $last = undef;
43c44
<                     $entry->{$fld} = $val;
---
>                   ${$last = \$entry->{$fld}} = $val;
45a47
>                   $last = undef;
47c49,50
<                     $entry->{'formats'}->{$format}->{'index'} = $val;
---
>                   $last = \$entry->{formats}->{$format}->{index};
>                   $$last = $val;
49c52,53
<                     $entry->{'formats'}->{$format}->{'files'} = $val;
---
>                   $last = \$entry->{formats}->{$format}->{files};
>                   $$last = $val
53,55c57,58
<             $lastfld = $fld;
<         } elsif (/^\s+/ and $lastfld ne '') {
<             $entry->{$lastfld} .= "\n$_";
---
>         } elsif (/^\s+/ and defined($last)) {
>             $$last .= "\n$_";

Reply via email to