Package: debian-policy X-Debbugs-Cc: j...@debian.org hel...@subdivi.de Debian only supports merged-usr since Bookworm. We should update policy to reference /usr/bin/sh and similar paths to describe recommended shebangs for scripts.
I heard many times the policy maintainers mention something along the lines of 'policy should not be a hammer to beat other maintainers with'. Today I saw policy being used to force a maintainer to re-add support for the deprecated and unsupported split-usr filesystem layout, as 'policy only mentions /bin/sh, not /usr/bin/sh'. So let's update the policy to refer to modern and supported filesystem paths as adopted by Debian de-facto and de-jure, and stop other maintainers from getting beaten with it. Patch attached and also pushed to https://salsa.debian.org/bluca/policy/-/tree/bin_sh -- Kind regards, Luca Boccassi
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luca Boccassi <bl...@debian.org> Date: Wed, 6 Sep 2023 22:41:58 +0100 Subject: [PATCH] Stop referring to legacy filesystem paths for shebangs Debian only supports merged-usr since bookworm. Use /usr/bin/sh and similar paths to describe recommended shebangs for scripts. --- policy/ch-files.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/policy/ch-files.rst b/policy/ch-files.rst index b34c183..ff9b2f6 100644 --- a/policy/ch-files.rst +++ b/policy/ch-files.rst @@ -211,8 +211,8 @@ may instead be easier to check the exit status of commands directly. See Every script should use ``set -e`` or check the exit status of *every* command. -Scripts may assume that ``/bin/sh`` implements the POSIX.1-2017 Shell Command -Language [#]_ plus the following additional features not mandated by +Scripts may assume that ``/usr/bin/sh`` implements the POSIX.1-2017 Shell +Command Language [#]_ plus the following additional features not mandated by POSIX.1-2017.. [#]_ - ``echo -n``, if implemented as a shell built-in, must not generate a @@ -248,16 +248,16 @@ POSIX.1-2017.. [#]_ If a shell script requires non-POSIX.1-2017 features from the shell interpreter other than those listed above, the appropriate shell must be specified -in the first line of the script (e.g., ``#!/bin/bash``) and the package +in the first line of the script (e.g., ``#!/usr/bin/bash``) and the package must depend on the package providing the shell (unless the shell package is marked "Essential", as in the case of ``bash``). You may wish to restrict your script to POSIX.1-2017 features plus the above -set when possible so that it may use ``/bin/sh`` as its interpreter. +set when possible so that it may use ``/usr/bin/sh`` as its interpreter. Checking your script with ``checkbashisms`` from the devscripts package or running your script with an alternate shell such as ``posh`` may help uncover violations of the above requirements. If in doubt whether a -script complies with these requirements, use ``/bin/bash``. +script complies with these requirements, use ``/usr/bin/bash``. Perl scripts should check for errors when making any system calls, including ``open``, ``print``, ``close``, ``rename`` and ``system``. @@ -266,7 +266,7 @@ including ``open``, ``print``, ``close``, ``rename`` and ``system``. Programming Considered Harmful*, one of the ``comp.unix.*`` FAQs, which can be found at http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/. If an upstream package comes with ``csh`` scripts then you must make sure -that they start with ``#!/bin/csh`` and make your package depend on the +that they start with ``#!/usr/bin/csh`` and make your package depend on the ``c-shell`` virtual package. Any scripts which create files in world-writeable directories (e.g., in @@ -780,7 +780,7 @@ restricted to ASCII when it is possible to do so. .. [#] These features are in widespread use in the Linux community and are implemented in all of bash, dash, and ksh, the most common shells - users may wish to use as ``/bin/sh``. + users may wish to use as ``/usr/bin/sh``. .. [#] This is necessary to allow top-level directories to be symlinks. If
signature.asc
Description: This is a digitally signed message part