Re: Erroneous postrm-unsafe-ldconfig?
Hi,
On Tue, Feb 22, 2005, Steve Halasz wrote:
> lintian gives the following complaint about the libgrass package:
> W: libgrass: postrm-unsafe-ldconfig
> The postrm is below and it looks to me like ldconfig will only be called
> when the first argument is remove. Am I missing something? Should I file
> a bug against lintian?
lintian does not "understand" what your shell script does, it only
checks it against some regular expressions, you can't ask lintian to
parse full-blown shell source code. Lintian does this:
# Decide if we do it safely
s/\bldconfig\b/BldconfigB/g;
s/[ \t]//g;
# this one matches code from debhelper
s/^if\["\$1"=.?remove.?\];?\n*then\n*BldconfigB//gm;
# variations...
s/^if\[.?remove.?="\$1"\];?\n*then\n*BldconfigB//gm;
s/^\["\$1"=.?remove.?\]\&&BldconfigB//gm;
s/^\[.?remove.?="\$1"\]&&BldconfigB//gm;
s!remove(?:|[^)]+)*\).*?BldconfigB.*?(;;|esac)!!s;
if (/^[^\#]*BldconfigB/m) {
tag "postrm-unsafe-ldconfig", "";
}
I'd suggest you split the ldconfig call to a separate block:
if [ "$1" = "remove" ]; then
ldconfig
fi
Or use an override.
Bye,
--
Loïc Minier <lool@dooz.org>
"Neutral President: I have no strong feelings one way or the other."
Reply to: