From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 8M/7NM9nd18IcgAA0tVLHw (envelope-from ) for ; Fri, 02 Oct 2020 17:47:59 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YA7PMM9nd19vEwAA1q6Kng (envelope-from ) for ; Fri, 02 Oct 2020 17:47:59 +0000 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 54CA3940215 for ; Fri, 2 Oct 2020 17:47:59 +0000 (UTC) Received: from localhost ([::1]:54024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOP9s-00036B-TH for larch@yhetil.org; Fri, 02 Oct 2020 13:47:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOP3H-0005KU-9A for guix-patches@gnu.org; Fri, 02 Oct 2020 13:41:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOP3F-0003mP-VR for guix-patches@gnu.org; Fri, 02 Oct 2020 13:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOP3F-0001FP-Tf for guix-patches@gnu.org; Fri, 02 Oct 2020 13:41:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43769] [PATCH 1/2] guix-install.sh: Add symbolic links for supported shell completions. References: <20201002173537.12045-1-zimon.toutoune@gmail.com> In-Reply-To: <20201002173537.12045-1-zimon.toutoune@gmail.com> Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Oct 2020 17:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43769 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43769@debbugs.gnu.org Cc: zimoun Received: via spool by 43769-submit@debbugs.gnu.org id=B43769.16016604414753 (code B ref 43769); Fri, 02 Oct 2020 17:41:01 +0000 Received: (at 43769) by debbugs.gnu.org; 2 Oct 2020 17:40:41 +0000 Received: from localhost ([127.0.0.1]:42456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOP2u-0001Eb-Ku for submit@debbugs.gnu.org; Fri, 02 Oct 2020 13:40:40 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOP2t-0001EP-3M for 43769@debbugs.gnu.org; Fri, 02 Oct 2020 13:40:39 -0400 Received: by mail-wm1-f67.google.com with SMTP id k18so2573049wmj.5 for <43769@debbugs.gnu.org>; Fri, 02 Oct 2020 10:40:39 -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:mime-version :content-transfer-encoding; bh=mgh8dKasq3+vOzIuIwjf2DrH98ynWraV+PKajWQUtwc=; b=SrHGlfP0Rl+PDUygsdPBLBEfwPfd1OFqO+PDysbPHNszVGa/uoigV0Zru4avZGriI3 MCBZEhhJG/5At3HQt33TabMz5CuwyOtBrkIy+1PxkLDC2QftR1ACaJ76Oh1QgA+KFUje 37EGCCzIESNDn5Bif+hZa/2f7D1o/0Dpa0KlhpW04pqUfz9QyIL1bOYc26eXb77CAwcR n5YJzlCjtc9t1vzzOKJInPNDmwU6H5e98o8usuXqVkWUt9qubT4KNc4YB4TCxrQx9zBk r9E1qSK4XNVrj//e0a2kSxt+C/PLFZKYnEB9L3Nl7d7dhQCH7cUe0C/+iSgxnNc+IsK7 S7dw== 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:mime-version :content-transfer-encoding; bh=mgh8dKasq3+vOzIuIwjf2DrH98ynWraV+PKajWQUtwc=; b=FB82PCwDyekIp7PuhpvldHaR2v6jdQwjYHsrcBrMIbhtitc+wIK5ESS92IZxsY3gpz ayb07+D9ZMu633gEDpqAAbBxxkOpJOvrzU5OiV3xjV3hBftiHyvPMZBRHS5yesc3sl9b UzCC/o6pVExrDNX52u5ycbjYyogQNqcfxMTvI8qBRzetd25gtB+YR9lenguUDRMxEa5B 0siBCNMPau8ljhtLxodDFNpgpzzowM7OGQxvSAnwPMNCy6OkfYPVcyuB9MKo9DyM6GEN hft4jbYD6n0DX/KjhZLII9Ch+o6CRuPwPNZRGJPSSmEfaQLn0TJeYECJeaZnkf1d+74r f7cA== X-Gm-Message-State: AOAM530yt8oAPTbJaBiC43P+8h9uZO1XwQY1GOmm6mVuvPwOrlMdhFWD yajwhD5qg1XamietSOAMNi9tjB/ebneKZw== X-Google-Smtp-Source: ABdhPJzW5bDnxd/TcDEawtjGjiHr4RMrKx2ePufeIIK22+EvRzwj/MLt16lFpT8wHQypYZRZ3vv3WQ== X-Received: by 2002:a7b:c750:: with SMTP id w16mr4158308wmk.16.1601660432864; Fri, 02 Oct 2020 10:40:32 -0700 (PDT) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id k82sm1312413wmf.15.2020.10.02.10.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 10:40:32 -0700 (PDT) From: zimoun Date: Fri, 2 Oct 2020 19:40:30 +0200 Message-Id: <20201002174030.13819-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=SrHGlfP0; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: yOi/Ir5xVOdc Fixes . * etc/guix-install.sh (sys_create_shell_completion): New function to add system wide all the symlinks for supported shell completions. --- etc/guix-install.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index eb7205a261..a5da198eb0 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -5,6 +5,7 @@ # Copyright © 2018 Efraim Flashner # Copyright © 2019, 2020 Tobias Geerinckx-Rice # Copyright © 2020 Morgan Smith +# Copyright © 2020 Simon Tournier # # This file is part of GNU Guix. # @@ -459,6 +460,36 @@ export XDG_DATA_DIRS="$GUIX_PROFILE/share:${XDG_DATA_DIRS:-/usr/local/share/:/us EOF } +sys_create_shell_completion() +{ # Symlink supported shell completions system-wide + + var_guix=/var/guix/profiles/per-user/root/current-guix + bash_completion=/etc/bash_completion.d + zsh_completion=/usr/share/zsh/site-functions + fish_completion=/usr/share/fish/vendor_completions.d + + while true; do + read -p "Install shell completion? (yes/no)" yn + case $yn in + [Yy]*) + { # Just in case + for dir_shell in $bash_completion $zsh_completion $fish_completion; do + [ -d "$dir_shell" ] || mkdir -p $dir_shell + done; + + ln -sf ${var_guix}/etc/bash_completion.d/* "$bash_completion"; + ln -sf ${var_guix}/share/zsh/site-functions/* "$zsh_completion"; + ln -sf ${var_guix}/share/fish/vendor_completions.d/* "$fish_completion"; } && + _msg "${PAS}Installed shell completion" + break;; + [Nn]*) _msg "${INF}Skipped shell completion installation" + break;; + *) _msg "Please answer yes or no."; + esac + done +} + + welcome() { cat<<"EOF" @@ -516,6 +547,7 @@ main() sys_enable_guix_daemon sys_authorize_build_farms sys_create_init_profile + sys_create_shell_completion _msg "${INF}cleaning up ${tmp_path}" rm -r "${tmp_path}" -- 2.28.0