GNU bug report logs - #40601
guix-install.sh: port to other distros & init systems

Previous Next

Package: guix-patches;

Reported by: Vincent Legoll <vincent.legoll <at> gmail.com>

Date: Mon, 13 Apr 2020 16:05:01 UTC

Severity: normal

Tags: patch

Done: Vincent Legoll <vincent.legoll <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #196 received at 40601 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40601 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys().
Date: Sun, 20 Dec 2020 18:28:35 +0100
* etc/guix-install.sh (chk_init_sys): Use `if something | grep' instead of "[["
pattern matching.
---
 etc/guix-install.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 9015f40bb6..26c8622855 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -143,11 +143,11 @@ chk_term()
 
 chk_init_sys()
 { # Return init system type name.
-    if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then
+    if /sbin/init --version 2>/dev/null | grep -q upstart; then
         _msg "${INF}init system is: upstart"
         INIT_SYS="upstart"
         return 0
-    elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then
+    elif systemctl 2>/dev/null | grep -q -- -\.mount; then
         _msg "${INF}init system is: systemd"
         INIT_SYS="systemd"
         return 0
-- 
2.29.2





This bug report was last modified 345 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.