From patchwork Sun May 17 17:17:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Legoll X-Patchwork-Id: 22173 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 E0CD427BBE4; Sun, 17 May 2020 18:20:20 +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 47B4E27BBE1 for ; Sun, 17 May 2020 18:20:20 +0100 (BST) Received: from localhost ([::1]:45590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaMxX-0001w7-RW for patchwork@mira.cbaines.net; Sun, 17 May 2020 13:20:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaMwU-0008Uc-6G for guix-patches@gnu.org; Sun, 17 May 2020 13:19:14 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaMwT-0004Oi-Pp for guix-patches@gnu.org; Sun, 17 May 2020 13:19:13 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaMwT-0007C1-LV for guix-patches@gnu.org; Sun, 17 May 2020 13:19:13 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40601] [PATCH 26/28] Add _debug_func() helper function Resent-From: Vincent Legoll Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 May 2020 17:19:13 +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.158973592327463 (code B ref 40601); Sun, 17 May 2020 17:19:13 +0000 Received: (at 40601) by debbugs.gnu.org; 17 May 2020 17:18:43 +0000 Received: from localhost ([127.0.0.1]:44620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMvz-00078n-6R for submit@debbugs.gnu.org; Sun, 17 May 2020 13:18:43 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMvT-00074n-HX for 40601@debbugs.gnu.org; Sun, 17 May 2020 13:18:12 -0400 Received: by mail-wm1-f66.google.com with SMTP id m185so2875717wme.3 for <40601@debbugs.gnu.org>; Sun, 17 May 2020 10:18:11 -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=jag/TTrlmDKE19yEhetNbRYZiC8DGMGy2oHhJkzWPI8=; b=uDk/jivmp55AQEm5zns/eOmKfQzCFaz/Ci8WI4bZUio6UDujmBvvrVL8POPXvK8AdB Jg0ZeFvoEipIMx9GtHvqViz7z6+ESXFHFB9cU2xNiFccpSTOPfnxvvewxrM8O1tyJIY3 HtZ8MNrFnQakhRXZJtYrk3GKqk4Ueu6WsZkgVRQoswHm2LzVXKpN2ejzmHFlyaDhYe72 M6A8c9Qj72YH+WJjKIl3tokqml90tpip2zj/8kna4ACjQIzlsxC/fUnIphbRDvUOfuKi 4Cx7+JCyhDIcTfnzLV1cInxf9qhoLmpDOigFim6HyhwDG/+K6fPHCslaBHvl+0ZM7227 XRzA== 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=jag/TTrlmDKE19yEhetNbRYZiC8DGMGy2oHhJkzWPI8=; b=s171sRXKT92WRkWgF1pJCAq/j3hDuI3mynSbfx/Nao5KoCpOBHTVgAQEed6ZrkrTfp buIXZPMiZrUTncVwPcD+NWNdxR2RLTwkhuKHW7IFjK2YvNA216Tx16X76O5X2jlQHzLE XsNc2mo8ntvr5S3F/un4yE1P1rELfCb8WvV6xxFMuD+FTIeQqNvgrhFZlRLmK7A0UCA+ Re51lEios8+8zbpKL5zYsz3botPzhltKpYrd/CK1+/sUrD+AQ3sHb/w0scdC2z5feVNn Yz8ihSvb+lsF+XBv8sBcX7o4vNKg1cOSSVifsZO721PrUhrFDMZYrGWXHqS4/aHjTL1z 2djw== X-Gm-Message-State: AOAM533r3PI5msB6EXUrl/DDifWVVkGf1vWJCILrdpFdT4bCJuW3Keo+ AxNxU1sHi+9hxtECNLWQqNkkMByb X-Google-Smtp-Source: ABdhPJytff3K/bOs6vlDdlBMOSc1E0khWUNT+BYiuk6+qdazINlCh5Xly+igZ5WGU20WISado7jtYg== X-Received: by 2002:a1c:2c0b:: with SMTP id s11mr11309882wms.97.1589735885015; Sun, 17 May 2020 10:18:05 -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.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 10:18:04 -0700 (PDT) From: Vincent Legoll Date: Sun, 17 May 2020 19:17:23 +0200 Message-Id: <20200517171725.732-26-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 | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 38f61de2f7..4ee350a155 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -85,12 +85,17 @@ _debug() fi } +_debug_func() +{ + # Display _debug_func() caller's function name + _debug "--- [ ${FUNCNAME[1]} ] ---" +} chk_require() { # Check that every required command is available. declare -a warn - _debug "--- [ $FUNCNAME ] ---" + _debug_func for c in "$@"; do command -v "$c" >/dev/null 2>&1 || warn+=("$c") @@ -105,7 +110,7 @@ chk_require() chk_gpg_keyring() { # Check whether the Guix release signing public key is present. - _debug "--- [ $FUNCNAME ] ---" + _debug_func # Without --dry-run this command will create a ~/.gnupg owned by root on # systems where gpg has never been used, causing errors and confusion. @@ -203,7 +208,7 @@ guix_get_bin_list() { # Scan GNU archive and save list of binaries gnu_url="$1" - _debug "--- [ $FUNCNAME ] ---" + _debug_func # Filter only version and architecture bin_ver_ls=("$(wget -qO- "$gnu_url" \ @@ -233,7 +238,7 @@ guix_get_bin() bin_ver="$2" dl_path="$3" - _debug "--- [ $FUNCNAME ] ---" + _debug_func _msg "${INF}Downloading Guix release archive" @@ -264,7 +269,7 @@ sys_create_store() pkg="$1" tmp_path="$2" - _debug "--- [ $FUNCNAME ] ---" + _debug_func # Do not use the --warning option with busybox tar TAROPTS=("-C" "${tmp_path}") @@ -297,7 +302,7 @@ sys_create_store() sys_create_build_group() { # Create the group for build users. - _debug "--- [ $FUNCNAME ] ---" + _debug_func if getent group guixbuild >/dev/null 2>&1; then _msg "${INF}group guixbuild already exists" @@ -316,7 +321,7 @@ sys_create_build_group() sys_create_build_user() { # Create the user accounts for build users. - _debug "--- [ $FUNCNAME ] ---" + _debug_func NOLOGIN_SHELL="$(command -v nologin)" for i in $(seq -w 1 10); do @@ -352,7 +357,7 @@ sys_create_build_user() sys_enable_guix_daemon() { # Run the daemon, and set it to automatically start on boot. - _debug "--- [ $FUNCNAME ] ---" + _debug_func case "$INIT_SYS" in upstart) @@ -420,7 +425,7 @@ sys_enable_guix_daemon() sys_make_guix_available() { # add guix into PATH - _debug "--- [ $FUNCNAME ] ---" + _debug_func info_path="/usr/local/share/info" local_bin="/usr/local/bin"