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

Bug#410042: lintian: please warn on effectively-empty maintscripts



Package: lintian
Severity: wishlist

Please warn on maintainer scripts which contain only

  shebang line			#!
  empty line			^$
  shell attribute manipulation	set	
  exit builtin			exit

On a machine without much cruft:

$ for f in /var/lib/dpkg/info/*.{pre,post}{inst,rm}; do grep -qvwe '^#!' -e '^$' -e '^set' -e '^exit 0' $f || echo $f; done;
/var/lib/dpkg/info/libapm1.preinst
/var/lib/dpkg/info/libgstreamer0.10-0.preinst
/var/lib/dpkg/info/libapm1.prerm
/var/lib/dpkg/info/libpam0g.prerm
/var/lib/dpkg/info/libpam-modules.prerm
/var/lib/dpkg/info/tct.prerm
/var/lib/dpkg/info/timeout.prerm
/var/lib/dpkg/info/wireshark-common.prerm
/var/lib/dpkg/info/libpam-modules.postinst
/var/lib/dpkg/info/tct.postinst
/var/lib/dpkg/info/timeout.postinst

Rationale:
An effectively-empty postrm will cause the package to be in "config
files" rather than "not installed".  It isn't assertive; doesn't check
that the arguments are one of the documented interfaces.  As such, it's
likely to be an error: an effectively empty script used for rollbacks
will succeed, even though nothing has actually been rolled back.  If old
{pre,post}rm upgrade fail, and that script exists in the new package,
but is effectively-empty, "failed-upgrade" will always succeed.  dpkg
would know that it should fail if the new file doesn't exist.  In the
unusual case that "upgrade" really had some effect, and failed-upgrade
shouldn't, then it makes sense to include a maintscript with the usual
case foo (which catches undocumented values of $1).



Reply to: