On 2018-02-05 13:25 -0500, Eli Schwartz wrote: > Package: xvfb > Version: 2:1.19.6-1 > Severity: minor > > Arch Linux has imported the xvfb-run script from Debian's package, but > our package dependencies do not mandate that the "which" utility be > installed. OTOH we do have it in our base package group, which users are > expected to have installed, although there is a bit of bikeshedding > about whether these unstated dependencies should actually be explicitly > listed... See the following xvfb bugreport on our bugtracker: > https://bugs.archlinux.org/task/56997 > > All that being said, this immediately made me think, why is the script > using `which` at all, rather than the POSIX `command -v` which is far > more portable as any #!/bin/sh shell has this as a builtin.
Historical reasons, POSIX has only mandated "command -v" since 2008 and Debian does not even require that /bin/sh supports it, since the Policy Manual specifies SUSv3 aka POSIX.2001 as the baseline[1]. As a consequence, the minimal posh shell does not support[2] "command -v" (not that using posh as /bin/sh is actually supported in Debian). See also bugs #747320[3] (talks about the "type" command, but mentions "command -v" in the last comment) and #864615[4] (requests that Debian should upgrade to SUSv4). Cheers, Sven 1. https://www.debian.org/doc/debian-policy/#scripts 2. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=397601 3. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747320 4. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864615