GNU bug report logs - #70148
[PATCH] guix-install.sh: Add daemonize to requirements.

Previous Next

Package: guix-patches;

Reported by: Richard Sent <richard <at> freakingpenguin.com>

Date: Tue, 2 Apr 2024 16:23:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Richard Sent <richard <at> freakingpenguin.com>
Cc: 70148 <at> debbugs.gnu.org, zimon.toutoune <at> gmail.com
Subject: [bug#70148] [PATCH v2] guix-install.sh: Add unique requirement for sysv init system
Date: Sun, 02 Jun 2024 11:45:27 +0200
Hi Richard,

Richard Sent <richard <at> freakingpenguin.com> skribis:

> This improves the installer's ability to detect that all requirements are
> present regardless of init system. It also avoids performing the requirement
> check twice (printing excessively to the console) and provides a framework for
> adding new init system specific requirements if it's needed in the future.
>
> * etc/guix-install.sh (add_init_sys_require): Create.
> (SYSV_INIT_REQUIRE): Create.
> (main_install): Reorder installer steps so all requirements are checked in one
> pass.
>
> Change-Id: Ic541c1b90499d504642b7ab4ae595501b1a37b0d
> ---
> Hi all,
>
> Here's an updated patch that is more selective about only checking for
> dependencies when it's required. It might be a touch overengineered,
> but I felt this was a better solution compared to hardcoding a
> daemonize requirement check in chk_init_sys or similar.

Neat!  I have one concern though:

> +add_init_sys_require()
> +{ # Add the elements of FOO_INIT_SYS to REQUIRE
> +    local init_require="${INIT_SYS}_REQUIRE[@]"
> +    if [[ ! -z "$init_require" ]]; then
> +        # Have to add piecemeal because ${!foo[@]} performs direct array key
> +        # expansion, not indirect plain array expansion.
> +        for r in "${!init_require}"; do
> +            REQUIRE+=("$r")
> +        done
> +    fi

‘local’, [[, and arrays are probably Bash-specific.  However this is a
#!/bin/sh script, and some systems such as Debian use Dash as /bin/sh.
So I’m afraid the script would break on such systems.

WDYT?  Do you think we can avoid those features?

So much for a script.  :-)

Thanks!

Ludo’.




This bug report was last modified 354 days ago.

Previous Next


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