From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#34279: guix-install.sh: uses /bin/bash shebang Date: Mon, 04 Feb 2019 22:26:03 +0100 Message-ID: <87lg2vp7o4.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:50133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqlli-0005xq-IB for bug-guix@gnu.org; Mon, 04 Feb 2019 16:27:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqllf-00089v-2b for bug-guix@gnu.org; Mon, 04 Feb 2019 16:27:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60488) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqlle-00089Q-J6 for bug-guix@gnu.org; Mon, 04 Feb 2019 16:27:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gqlle-0000Ke-9f for bug-guix@gnu.org; Mon, 04 Feb 2019 16:27:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: ("Claes Wallin \=\?utf-8\?B\?KOmfi+WYieiqoCkiJ3M\=\?\= message of "Fri, 1 Feb 2019 16:35:56 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: "Claes Wallin (=?UTF-8?Q?=E9=9F=8B=E5=98=89=E8=AA=A0?=)" Cc: 34279@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Claes Wallin (=E9=9F=8B=E5=98=89=E8=AA=A0) skribis: > This means ./guix-install.sh doesn't work on e.g. NixOS. :-) > > Please use /usr/bin/env bash. /usr/bin/env wouldn=E2=80=99t work on Guix System by default. :-) What about something like this: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 8eb5214049..dc8de2fe92 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # GNU Guix --- Functional package management for GNU # Copyright =C2=A9 2017 sharlatan # Copyright =C2=A9 2018 Ricardo Wurmus @@ -19,6 +19,13 @@ # You should have received a copy of the GNU General Public License # along with GNU Guix. If not, see . =20 +# We require Bash but for portability we'd rather not use /bin/bash or +# /usr/bin/env in the shebang, hence this hack. +if [ "x$BASH_VERSION" =3D "x" ] +then + exec bash "$0" "$@" +fi + set -e =20 [ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; } --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQpUaGFua3MsDQpMdWRv4oCZLg0K --=-=-=--