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


View this message in rfc822 format

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40601 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [bug#40601] [PATCH 28/28] Remove "[[" bashisms in chk_init_sys()
Date: Sun, 17 May 2020 19:17:25 +0200
---
 etc/guix-install.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index be2fd74905..45b4c4b720 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -139,23 +139,23 @@ 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
-    elif [[ $(rc -V 2>/dev/null) =~ OpenRC ]]; then
+    elif rc -V 2>/dev/null | grep -q OpenRC; then
         _msg "${INF}init system is: openrc"
         INIT_SYS="openrc"
         return 0
-    elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then
+    elif [ -f /etc/init.d/cron ] && [ ! -h /etc/init.d/cron ]; then
         _msg "${INF}init system is: sysv-init"
         INIT_SYS="sysv-init"
         return 0
-    elif [[ -d /etc/sv ]]; then
+    elif [ -d /etc/sv ]; then
         _msg "${INF}init system is: runit"
         INIT_SYS="runit"
         return 0
-- 
2.26.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.