retitle 444889 Fails on doc-base files ending with spaces found 444889 0.8.5 clone 444889 -1 -2 -3 reassign -1 debhelper 5.0.57 retitle -1 Creates doc-base files ending with spaces when "Document" field has trailing spaces tags -1 patch reassign -2 lintian 1.23.34 reassign -3 linda 0.3.26 thanks
On Mon, 1 Oct 2007, Ian Zimmerman wrote:
Hi,
>
> I misdiagnosed this. Although lintian could handle this more gracefully,
> the real problem is that doc-base cannot handle trailing spaces
> on the Document: line.
Firstly, according to the doc-base Manual (section 2.2) whitespaces are not
allowed in the Document field. Currently none of doc-base, lintian, and
linda check for this, although they should.
To diagnose the problem, I created simple test package (attached to this
mail) with a debian/doc-base file which Document field has four trailing
spaces. I built it, and noted that:
1) it contains file "/usr/share/doc-base/test444889 " (with 4 spaces)
2) lintian fails with the following error:
internal error: cannot open doc-base file test444889 for reading.
internal error: cannot run menus check on package test444889
3) linda outputs:
Check FilesCheck failed. Exception KeyError thrown
('/usr/share/doc-base/test444889').
4) installing fails:
Setting up test444889 (1) ...
Can't read doc-base file `/usr/share/doc-base/test444889'
dpkg: error processing test444889 (--install):
subprocess post-installation script returned error exit status 1
5) manually registering the file with install-docs -i
"/usr/share/doc-base/test444889 ":
Error in `/usr/share/doc-base/test444889 : cannot open file for reading:
No such file or directory
The reason for 1) and 4) is dh_installdocs which creates the file in
binary package, but does not quote the file name in the postinst/prerm
scripts.
Most probably debhelper shouldn't generate such a file name,
and dh_installdocs already contains the following code:
while (<IN>) {
if (/^Document:\s+(.*)(\s+)?/) {
$doc_ids{$fn}=$1;
which I think was meant for avoiding such problems like this one.
Unfortunately it doesn't work. The solution would be using non-greedy
pattern matching by adding '?' just after '*' in the regexp, i.e:
/^Document:\s+(.*?)(\s+)?/
`install-docs -i' (point 5) and lintian (point 2) fail because they use
two-argument open call (i.e. open F, $file), what causes perl to strip
trailing whitespaces from the file name. Using the three-argument syntax
(open F, "<", $file) works.
I have no idea why linda (point 2) fails.
Best Regards,
robert
test444889_1.tar.gz
Description: Binary data
signature.asc
Description: Digital signature

