From patchwork Thu May 7 18:45:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wouter Wijsman X-Patchwork-Id: 1627 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 5371018A2603D for ; Thu, 7 May 2020 18:45:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=DMARC_FAIL_NONE=0.25, FREEMAIL_FROM=0.5,MAILING_LIST_MULTI=-1,MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,T_DMARC_POLICY_NONE=0.01, T_DMARC_TESTS_FAIL=0.01 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Thu, 7 May 2020 18:45:32 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 566641B96393F4; Thu, 7 May 2020 18:45:23 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id DFA101B96393EC; Thu, 7 May 2020 18:45:22 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=none Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id CA8AE29CD5; Thu, 7 May 2020 18:45:22 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=none Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 45D4A29CD5 for ; Thu, 7 May 2020 18:45:20 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Thu, 7 May 2020 18:45:20 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id BEF451B96393EA for ; Thu, 7 May 2020 18:45:14 +0000 (UTC) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067089.outbound.protection.outlook.com [40.92.67.89]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Thu, 7 May 2020 18:45:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PJ/2EgT+UNkUScIuYPatFIIBZ0QSmJ8g/KD+DJiBncfjBa0lUtUPTRGYBJgRR8IX0YIwPemyID6fyhaxin5Ub0miCbXq2FCRy6oscTYdF6NdfVwKtPfekNoE5y2AZFO1NJMMZxjxfvp4TYxkO+gbQFXNuI9tJwewGR4f3PiPeoTFeTGE+zVKA242stt6JT8LM89rzGJVCn8BKB6OWoK4QQS//CrDaBgaCxIcvG5Rudp7tpqj+PqWyC2eDBpx9ibbe+qb7jj0oUk9uFewVGkBvSDnwXhYaJe5JEJZn2KrrJeRzPpUxmdEGsrBADNW0Hz7R/ARDYtnsFBenpjTd22pDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UMExIgl3vK+nVgA1AtW6zx/cGWKj9HMzTg9QCj2LwlU=; b=dmbC7A05UaaOeEmgRANgxIreg4MdunSBzLgCwQ4xxLtXQ/bYnxzjVrQZU2ZPcBl8KD2LXDlIIhFvoKCIyn375FMbSH5tKQNXNXPQcBvjTjpoXDHpGYPXHokFJtpL4eX42iuSM/k6paM1b3wX0OdITB54id1CqQU0T/BPDB86Y/RVdvDLUf0v3v8jQYppGKXvNhhPG+97F0fEE5Hdmp0uG6wXWXOpaxTTzNBQwzGGDRzzsYXp5M5QYkn7DZXiozitZyIPuCZ8bdneL7jdT2ior78Og3cbtfLKRFqH5/eeSmMvIhe61GUgfYS4DdzS4T9gHbzUVeLtq0i2zPwMpP/e3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.nl; dmarc=pass action=none header.from=live.nl; dkim=pass header.d=live.nl; arc=none Received: from HE1EUR02FT062.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1d::51) by HE1EUR02HT151.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1d::382) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27; Thu, 7 May 2020 18:45:13 +0000 Received: from DB7PR10MB2508.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:7e1d::4b) by HE1EUR02FT062.mail.protection.outlook.com (2a01:111:e400:7e1d::352) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Thu, 7 May 2020 18:45:13 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:86E38749B6B7C970B44CC45C1808D7A00A7526F2BC8CE8E000C8943D959546A8; UpperCasedChecksum:5A13F153030CBC395D034D8686552777D66860A864CE7C7010AAD397CAE16998; SizeAsReceived:7410; Count:48 Received: from DB7PR10MB2508.EURPRD10.PROD.OUTLOOK.COM ([fe80::28c2:2f5b:dd0a:400]) by DB7PR10MB2508.EURPRD10.PROD.OUTLOOK.COM ([fe80::28c2:2f5b:dd0a:400%6]) with mapi id 15.20.2958.034; Thu, 7 May 2020 18:45:13 +0000 From: Wouter Wijsman To: pacman-dev@archlinux.org Date: Thu, 7 May 2020 20:45:05 +0200 Message-ID: X-Mailer: git-send-email 2.20.1 X-ClientProxiedBy: AM0PR01CA0099.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::40) To DB7PR10MB2508.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:4c::28) X-Microsoft-Original-Message-ID: <20200507184505.31938-1-wwijsman@live.nl> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (82.197.214.235) by AM0PR01CA0099.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26 via Frontend Transport; Thu, 7 May 2020 18:45:12 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200507184505.31938-1-wwijsman@live.nl> X-TMN: [4sTHyj2zTXiHhtnCWJmY/s1Ip3vOV8Li] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 73a1fe87-2918-4d8c-7d37-08d7f2b6c67f X-MS-TrafficTypeDiagnostic: HE1EUR02HT151: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5aTAAYgAubP3m5yVSVlN+0y/fuMV7J9anTDsdQHEsRm1UDOxpzth4CTm4JTvfHaZQhUl6BMFreZdpz2M9c0cOXTo8/B+wmzE0736Cd4s/goElRTT2zO81fG6kQrjmQe7doftso25FzCwS+lBHHcsTa0ctQhcJqAEM+yfz9/Yk1PZAa9cecAal/Kr4iUAStXrr0LwfJsj+kBYC3nvUbtV3w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:0; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR10MB2508.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:; DIR:OUT; SFP:1901; X-MS-Exchange-AntiSpam-MessageData: 4bol2SX/SJTiD4+wHf7PcXxKpkIcdcMzZkTa5gyXxmI8DXc4Kilv6j+dUEcTElBdftAZ4OIhfGdlfLiYa+FKH8kepWJvkeNmO8NfJSNyDNz6PFktHUc/4qGpio6X/EXzD8ZcL484gQ5azzMLNXYQPg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73a1fe87-2918-4d8c-7d37-08d7f2b6c67f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2020 18:45:13.4162 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR02HT151 Subject: [pacman-dev] [PATCH] Make bash-completion optional X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Discussion list for pacman development Errors-To: pacman-dev-bounces@archlinux.org Sender: "pacman-dev" The bash completion files were the only reason pacman was not able to build as a non-root user. This patch adds the option to not install these files. This was needed for my use case, hopefully upstream someone else has a use for it as well. Signed-off-by: Wouter Wijsman --- meson_options.txt | 3 +++ scripts/meson.build | 44 +++++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 4d8cc300..2927cd15 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -51,6 +51,9 @@ option('gpgme', type : 'feature', value : 'auto', option('i18n', type : 'boolean', value : true, description : 'enable localization of pacman, libalpm and scripts') +option('bash-completion', type : 'boolean', value : true, + description : 'install bash-completion files') + # tools option('file-seccomp', type: 'feature', value: 'auto', description: 'determine whether file is seccomp-enabled') diff --git a/scripts/meson.build b/scripts/meson.build index d2466523..12262e98 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -68,25 +68,27 @@ configure_file( output : '@BASENAME@', install_dir : join_paths(DATAROOTDIR, 'pkgconfig')) -custom_target( - 'bash_completion', - command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], - input : 'completion/bash_completion.in', - output : 'pacman', - install : true, - install_dir : BASHCOMPDIR) - -foreach symlink : ['pacman-key', 'makepkg'] - meson.add_install_script(MESON_MAKE_SYMLINK, - 'pacman', - join_paths(BASHCOMPDIR, symlink)) -endforeach +if get_option('bash-completion') + custom_target( + 'bash_completion', + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : 'completion/bash_completion.in', + output : 'pacman', + install : true, + install_dir : BASHCOMPDIR) -zsh_completion_dir = join_paths(DATAROOTDIR, 'zsh/site-functions') -custom_target( - 'zsh_completion', - command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], - input : 'completion/zsh_completion.in', - output : '_pacman', - install : true, - install_dir : zsh_completion_dir) + foreach symlink : ['pacman-key', 'makepkg'] + meson.add_install_script(MESON_MAKE_SYMLINK, + 'pacman', + join_paths(BASHCOMPDIR, symlink)) + endforeach + + zsh_completion_dir = join_paths(DATAROOTDIR, 'zsh/site-functions') + custom_target( + 'zsh_completion', + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : 'completion/zsh_completion.in', + output : '_pacman', + install : true, + install_dir : zsh_completion_dir) +endif