From patchwork Sun May 17 17:17:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Legoll X-Patchwork-Id: 22167 X-Patchwork-Delegate: mail@cbaines.net Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3B55227BBE4; Sun, 17 May 2020 18:20:01 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id ABD8927BBE1 for ; Sun, 17 May 2020 18:20:00 +0100 (BST) Received: from localhost ([::1]:44012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaMxE-0001Kb-5w for patchwork@mira.cbaines.net; Sun, 17 May 2020 13:20:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaMvP-0007St-2q for guix-patches@gnu.org; Sun, 17 May 2020 13:18:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaMvO-0004Ca-Pr for guix-patches@gnu.org; Sun, 17 May 2020 13:18:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaMvO-000750-MX for guix-patches@gnu.org; Sun, 17 May 2020 13:18:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40601] [PATCH 07/28] guix-install.sh: Move code in a new function. Resent-From: Vincent Legoll Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 May 2020 17:18:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40601 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40601@debbugs.gnu.org Cc: Vincent Legoll Received: via spool by 40601-submit@debbugs.gnu.org id=B40601.158973588527189 (code B ref 40601); Sun, 17 May 2020 17:18:06 +0000 Received: (at 40601) by debbugs.gnu.org; 17 May 2020 17:18:05 +0000 Received: from localhost ([127.0.0.1]:44568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMvM-000740-If for submit@debbugs.gnu.org; Sun, 17 May 2020 13:18:05 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMvB-00071I-ER for 40601@debbugs.gnu.org; Sun, 17 May 2020 13:17:53 -0400 Received: by mail-wm1-f67.google.com with SMTP id u188so7755990wmu.1 for <40601@debbugs.gnu.org>; Sun, 17 May 2020 10:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8gNStNg88YD5Kn8bnefVqMYHDyPrfA+9fsyDVjiARFA=; b=C9YkW51Cskar2pyN6kkgL8rsJpvhVC2xtRP2hyQWy3GndJNemAQZE1uCerb0NXwWw8 kjWzgHElIe4MMWn6vgXD/FsgSCbC2nIyMMQVgjPKZQkFjrVFN4lmMyHaVrzPzYcLDot/ 02UWiCrxkMyaKqoZdasDAHUhtOGxJprrMtF0E2rXaUy+ZKWRkUsSxviuGN+t9JAPBLaF dxHjSFOzYeIZA1fo9Q4/9Jav1kKdjjNab5J/5D0sPy4/IooaQeo6ZPpZ7W+wHcWZ+Kmg EQVA/rqrAR7jIZRUfocm1PmlYsjaFuLT6W3MFws+3sF2rgZlRAJOtJCKsio4JJYa8Dql HXJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8gNStNg88YD5Kn8bnefVqMYHDyPrfA+9fsyDVjiARFA=; b=XgjWeNXPqrK1bqiDSLwR+ItGkJRp8PhSoa5urBWF6hb30+eJq2TFWJVS4eHmc1ggeA IsomMiqPBmqxWaPCQRW9xzxJ0JsQiPDPBHa4bC9VUmRCYuratFqL7oaVL5rf8g12/g8S Zhc3lhAQ+yqSp1g9UcB4CwT11ymuDUkvgOLWb8w7n8VDzwBp8Q9fCq+DJ+dZLmEp7Kzg IGpuUIhqZAkfGzhBi0GNPLSY2t+UXG9uTbqekUUJ50uFsP0aONXbZIL5YU6LsX/NQpR9 clVjbm6Q9gvFeiwktzhApCTBA9MKDAEim0x07fuailBCMlIFBn/zS7dUX7RM+7/v5uS5 /buA== X-Gm-Message-State: AOAM531imJ4yDw7aXfMUqCiNNKeIIAft1TmEJQrV7SEqmp0a0Nqvy7zs l0+0L3tjlVhR6TcyQyquGflqGKRA X-Google-Smtp-Source: ABdhPJx4YtphdmZnHmVF3DiEC4wiDpWUNeMPJEYZ4q9aONx0DU9hitIRXQczdN29TkGRzo/Kzrbg7A== X-Received: by 2002:a1c:2c0b:: with SMTP id s11mr11309060wms.97.1589735867600; Sun, 17 May 2020 10:17:47 -0700 (PDT) Received: from localhost.localdomain (se167-1-82-242-148-1.fbx.proxad.net. [82.242.148.1]) by smtp.gmail.com with ESMTPSA id v126sm13305048wma.9.2020.05.17.10.17.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 10:17:47 -0700 (PDT) From: Vincent Legoll Date: Sun, 17 May 2020 19:17:04 +0200 Message-Id: <20200517171725.732-7-vincent.legoll@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200517171725.732-1-vincent.legoll@gmail.com> References: <20200517171725.732-1-vincent.legoll@gmail.com> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * etc/guix-install.sh (sys_enable_guix_daemon): Move code from here... (sys_make_guix_available): ...to this new function, fixing whitespace... (main): ...and call it here. --- etc/guix-install.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 078aa4a781..225cf532b8 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -330,16 +330,8 @@ sys_create_build_user() sys_enable_guix_daemon() { # Run the daemon, and set it to automatically start on boot. - local info_path - local local_bin - local var_guix - _debug "--- [ $FUNCNAME ] ---" - info_path="/usr/local/share/info" - local_bin="/usr/local/bin" - var_guix="/var/guix/profiles/per-user/root/current-guix" - case "$INIT_SYS" in upstart) { initctl reload-configuration; @@ -391,11 +383,25 @@ sys_enable_guix_daemon() echo " ${ROOT_HOME}/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild" ;; esac +} + +sys_make_guix_available() +{ # add guix into PATH + + local info_path + local local_bin + local var_guix + + _debug "--- [ $FUNCNAME ] ---" + + info_path="/usr/local/share/info" + local_bin="/usr/local/bin" + var_guix="/var/guix/profiles/per-user/root/current-guix" _msg "${INF}making the guix command available to other users" [ -e "$local_bin" ] || mkdir -p "$local_bin" - ln -sf "${var_guix}/bin/guix" "$local_bin" + ln -sf "${var_guix}/bin/guix" "$local_bin" [ -e "$info_path" ] || mkdir -p "$info_path" for i in ${var_guix}/share/info/*; do @@ -505,6 +511,7 @@ main() sys_create_store "${TARBALL}" "${tmp_path}" sys_create_build_user sys_enable_guix_daemon + sys_make_guix_available sys_authorize_build_farms sys_create_init_profile