From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id cNJNKZo/XGZ0DQEAA41jLg (envelope-from ) for ; Sun, 02 Jun 2024 11:47:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id yBoaJpo/XGaNZAEA62LTzQ (envelope-from ) for ; Sun, 02 Jun 2024 11:47:06 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=YiP+t+BF; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1717321626; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=FmNIaWGO+Wi7FvG2jTwQB3M0RoPHpNTyzNmeqUTsink=; b=BctoTdXpBTJj40tQvOBuIaLahnVyrG4aw68AhlLc6G/ryVR4x+zvKo/OzujLW2c6yGMr6l V4n9pl07GDN7ruQ2HVyo2aQ65+WbeiMPCh/y4HIdbJ1yAD2FER1hbDcE9LMEaC6wRdxdxp Tcm0nNAlS8gpgf+rWeL3bzsdgMG8v4XAZfrJ4UIV68CQiwZBFtpSy6RE6CsXQNw1kNF85g /DX1bYq79NJzz/NHSxb+4gBYN26K4prFckvAqvAnRrohQ6+eBQiPdHsKuYSjRiMyE+qghX WZoeCzcGku3jisuWgWYPU1BVqMcMsQtLsdNgnF78P1MBZ9qUfWvD0NlCheEU/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=YiP+t+BF; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1717321626; a=rsa-sha256; cv=none; b=mAgYny3O4qvXaA+ilk+ZCJmkO5fQLl1H5jUd6j1qHwvFy9BIFQJuRhB0NTp9UyFCBOk0gy 0J+McOXm7y/10cg89VRJ5sx95IW7+EbJkZaHnEcG0oMlb9Borwq7jqoKvkrRBnV3csEpob m9+tPkBIHx4mdh7Hl7aZTU2glM4FePy8s0gKAoh2Kuf7IZT9FVXI/fGZ6m3lNLvGwWGsbM 6S4/sc8xYT4uZaTbeiJQhqOOXITFg3hmey45ciVUSSGCW4ZnKpTYyufshNqsxcE/XtZk0X eZV2JQo49YFa9NfMVtgR1KbcNdeyRyqvo+WTeTDEdwzMvpbfAYMPOP+NbKvXfw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 898B766217 for ; Sun, 2 Jun 2024 11:47:06 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sDhnr-0000ey-1n; Sun, 02 Jun 2024 05:47:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sDhne-0000eI-DV for guix-patches@gnu.org; Sun, 02 Jun 2024 05:46:50 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sDhne-0006pP-2D for guix-patches@gnu.org; Sun, 02 Jun 2024 05:46:50 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sDhnq-0001DP-5J for guix-patches@gnu.org; Sun, 02 Jun 2024 05:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70148] [PATCH v2] guix-install.sh: Add unique requirement for sysv init system Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 02 Jun 2024 09:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70148 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Richard Sent Cc: 70148@debbugs.gnu.org, zimon.toutoune@gmail.com Received: via spool by 70148-submit@debbugs.gnu.org id=B70148.17173215644575 (code B ref 70148); Sun, 02 Jun 2024 09:47:02 +0000 Received: (at 70148) by debbugs.gnu.org; 2 Jun 2024 09:46:04 +0000 Received: from localhost ([127.0.0.1]:57854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDhmu-0001Bi-7O for submit@debbugs.gnu.org; Sun, 02 Jun 2024 05:46:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDhmr-0001BD-OO for 70148@debbugs.gnu.org; Sun, 02 Jun 2024 05:46:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sDhma-0006mM-5Z; Sun, 02 Jun 2024 05:45:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=FmNIaWGO+Wi7FvG2jTwQB3M0RoPHpNTyzNmeqUTsink=; b=YiP+t+BFU0fT8Rj5SIct 0ztplLWZ28yZ3tOQsJT3Wl9ULtdLUCCr81HLSYS29ddC1uu1UvT0NUTnkxA33YRQ5esISRD7ZjQGT Dn9bAuHPX/UpI6dZ2aWJM9qo/XB/uwnzm3fsFD8YoxcrR87s9jUr53iCMZQjqINM1aQ9LCuiIukNL RZwAWfYaeE5dbHFblA+zfwKFCcXhuB4igg8iFf90P/OKQrNthHfbuWvxjkILZho8W5HYdFqUSK02I JPIlr6rVJ43zHzDbcR/Tbj39jgLHc/lWtZBF+YvOZ3e4foG93Vv4zGefobkvyJ+LF4jJkzLcbz8v1 iAZBdtPor09xcQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <4253a50c53caa41f468163c6f9f8730e86678f38.1716942966.git.richard@freakingpenguin.com> (Richard Sent's message of "Tue, 28 May 2024 20:36:06 -0400") References: <4e4fa72cfff690365f06c94534bc3d03ac7a3418.1712074456.git.richard@freakingpenguin.com> <4253a50c53caa41f468163c6f9f8730e86678f38.1716942966.git.richard@freakingpenguin.com> Date: Sun, 02 Jun 2024 11:45:27 +0200 Message-ID: <87a5k3n0eg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.24 X-Spam-Score: -7.24 X-Migadu-Queue-Id: 898B766217 X-Migadu-Scanner: mx13.migadu.com X-TUID: hrpB4tMOcFmN Hi Richard, Richard Sent skribis: > This improves the installer's ability to detect that all requirements are > present regardless of init system. It also avoids performing the requirem= ent > check twice (printing excessively to the console) and provides a framewor= k 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 i= n 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=3D"${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+=3D("$r") > + done > + fi =E2=80=98local=E2=80=99, [[, and arrays are probably Bash-specific. Howeve= r this is a #!/bin/sh script, and some systems such as Debian use Dash as /bin/sh. So I=E2=80=99m afraid the script would break on such systems. WDYT? Do you think we can avoid those features? So much for a script. :-) Thanks! Ludo=E2=80=99.