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

Bug#953428: lintian: Errors when using /usr/bin/env in scripts



Hi Martin,

On Mon, Mar 9, 2020 at 10:33 AM Martin Burchell
<martinburchell@spamcop.net> wrote:
>
> E: camcops-server: unknown-control-interpreter control/postinst #!/usr/bin/env
> E: camcops-server: forbidden-postrm-interpreter #!/usr/bin/env
> E: camcops-server: unknown-control-interpreter control/preinst #!/usr/bin/env
> E: camcops-server: unknown-control-interpreter control/prerm #!/usr/bin/env

All of the tags relate to maintainer scripts. Lintian does not allow
the use of env in them, but gives a poor reason in the the tag
description for 'forbidden-postrm-interpreter':

    The purge action of postrm can only rely on essential packages

Of course, 'env' is in coreutils, which is essential.

> Does Debian Policy prohibit the use of /usr/bin/env? If I replace /usr/bin/env
> with /bin/bash I don't get the errors.

Do you have to use env? What is wrong with hardcoding the path? Also,
shouldn't a maintainer script wish to rely on a known interpreter?

> It isn't explicit from the lintian error message or from reading the policy
> that this is the case.

I will amend the tag description when we resolve this bug

> In addition, https://lintian.debian.org/tags/script-uses-bin-env.html seems to
> imply that /usr/bin/env is OK but /bin/env isn't.

That tag is for regular scripts (i.e. not maintainer scripts). The use
of env will not produce any complaints there.

Kind regards
Felix Lechner


Reply to: