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

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



Package: lintian
Version: 2.5.81ubuntu1
Severity: normal

Dear Maintainer,
When running lintian (latest from https://salsa.debian.org/lintian/lintian/) on a package we've built
(https://github.com/RudolfCardinal/camcops/releases/download/v2.3.7/camcops-
server_2.3.7-1_all.deb) we get the following errors:

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

This is because the all the scripts in question have as the first line:
#!/usr/bin/env bash

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.

It isn't explicit from the lintian error message or from reading the policy
that this is the case. The only reference I can find in the policy is the
example in section 10.4 which says "All command scripts, including the package
maintainer scripts inside the package and used by dpkg, should have a #!line
naming the shell to be used to interpret them". In the case of Perl scripts
this should be #!/usr/bin/perl."

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.




-- System Information:
Debian Release: buster/sid
  APT prefers bionic-updates
  APT policy: (500, 'bionic-updates'), (500, 'bionic-security'), (500, 'bionic'), (100, 'bionic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-74-generic (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages lintian depends on:
ii  binutils                          2.30-21ubuntu1~18.04.2
ii  bzip2                             1.0.6-8.1ubuntu0.2
ii  diffstat                          1.61-1build1
ii  dpkg                              1.19.0.5ubuntu2.3
ii  file                              1:5.32-2ubuntu0.3
ii  gettext                           0.19.8.1-6ubuntu0.3
ii  intltool-debian                   0.35.0+20060710.4
ii  libapt-pkg-perl                   0.1.33build1
ii  libarchive-zip-perl               1.60-1ubuntu0.1
ii  libclass-accessor-perl            0.51-1
ii  libclone-perl                     0.39-1
ii  libdpkg-perl                      1.19.0.5ubuntu2.3
ii  libemail-valid-perl               1.202-1
ii  libfile-basedir-perl              0.07-1
ii  libipc-run-perl                   0.96-1
ii  liblist-moreutils-perl            0.416-1build3
ii  libparse-debianchangelog-perl     1.2.0-12
ii  libperl5.26 [libdigest-sha-perl]  5.26.1-6ubuntu0.3
ii  libtext-levenshtein-perl          0.13-1
ii  libtimedate-perl                  2.3000-2
ii  liburi-perl                       1.73-1
ii  libxml-simple-perl                2.24-1
ii  libyaml-libyaml-perl              0.69+repack-1
ii  man-db                            2.8.3-2ubuntu0.1
ii  patchutils                        0.3.4-2
ii  perl                              5.26.1-6ubuntu0.3
ii  t1utils                           1.41-2
ii  xz-utils                          5.2.2-1.3

Versions of packages lintian recommends:
ii  libperlio-gzip-perl  0.19-1build3

Versions of packages lintian suggests:
pn  binutils-multiarch     <none>
ii  dpkg-dev               1.19.0.5ubuntu2.3
ii  libhtml-parser-perl    3.72-3build1
pn  libtext-template-perl  <none>

-- no debconf information


Reply to: