From patchwork Tue Apr 2 09:13:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via arch-projects X-Patchwork-Id: 1058 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 F1C46CE9DBD0 for ; Tue, 2 Apr 2019 09:13:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00=-1, DKIMWL_WL_HIGH=-0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3, T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Tue, 2 Apr 2019 09:13:55 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id D68ED11ADC852F; Tue, 2 Apr 2019 09:13:53 +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) by orion.archlinux.org (Postfix) with ESMTPS; Tue, 2 Apr 2019 09:13:53 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id AEF9C207AA; Tue, 2 Apr 2019 09:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1554196433; bh=Bta0SLPqZmz4CHN+Xjj5Z14tE2BKN+BN7IP1ofD3u/w=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc; b=DzYuXt9Oul3w9K5ZXnitXFwqfrlpeFo4rQbwnr5mkZx9uee+gnbeh21ZXmdeTdNAG 4asKf7VDUP/KmYu6f/W41lwy5qEOkzRidX1fORfdpcCeNRCBismBdTZ/f9HWeCr/S/ 1yqovzhYnHOIJk+vgU9yhY4lIunB8XqQk9qKhyZXEHexRa4PFK/qknjGK84GCtCRBG wWGLSZw6zPkzEQaEMMBeFZPhZ55kSceHzd+kzEjarJvHlAnsLNKLIkQZ9yozed+/yy w0mwLlRWbHlL4wpSKOV0E44Oo3p0n+OIX4SPRiYa10Tdwx8+NsA/ThZbfPAtaPZmSP 7Q9eRJLYQRaWf/05UiRAww3oa9BG7AYAv/SLsOVHosXjbcyt0jJJiBrbLL+qE8ztOH kzkHHyFv296vLll9Pg5F+Qcmek+kCoOVvL8ECVnvpTpryexeWUmtv0rEt5gnECiim+ xd+6L9bHvQKVc9x/TF2glWJx//BMdUAUYkWTQgpAOEWe9+lydXh9Y0BZ2hPaYbFDcY mQcLkp4LrX57WYR70Dc91f6ekle81NxqbvYXh/jPxqbku9hC0gXX3j3LgRn1it014n SxRpzwTKfO8BNLAG4uuET3or1E/vFV3Hdq7upsO9SDUHtQBJrH/XgC7Z2jJKZJeWKv 5CVj+aBNKVV02Qgqf/b6kjN8= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id E976C2079C for ; Tue, 2 Apr 2019 09:13:51 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Tue, 2 Apr 2019 09:13:51 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 922F311ADC852A for ; Tue, 2 Apr 2019 09:13:50 +0000 (UTC) Received: from szilassi.eckner.net (szilassi.eckner.net [IPv6:2a03:4000:2a:1bc::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Tue, 2 Apr 2019 09:13:50 +0000 (UTC) Received-SPF: none (Address does not pass the Sender Policy Framework) SPF=HELO; sender=nlopc43.ioq.uni-jena.de; remoteip=::ffff:141.35.50.156; remotehost=nlopc43.ioq.uni-jena.de; helo=nlopc43.ioq.uni-jena.de; receiver=szilassi.eckner.net; Received-SPF: fail (Address does not pass the Sender Policy Framework) SPF=MAILFROM; sender=arch@eckner.net; remoteip=::ffff:141.35.50.156; remotehost=nlopc43.ioq.uni-jena.de; helo=nlopc43.ioq.uni-jena.de; receiver=szilassi.eckner.net; Received: from nlopc43.ioq.uni-jena.de (nlopc43.ioq.uni-jena.de [::ffff:141.35.50.156]) (AUTH: PLAIN erich@eckner.net, ) by szilassi.eckner.net with ESMTPSA id 0000000000820019.000000005CA327CE.00004CAA; Tue, 02 Apr 2019 11:13:50 +0200 To: arch-projects@archlinux.org Date: Tue, 2 Apr 2019 11:13:16 +0200 Message-Id: <20190402091315.13266-1-arch@eckner.net> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401094154.27020-1-arch@eckner.net> References: <20190401094154.27020-1-arch@eckner.net> Mime-Version: 1.0 Received-SPF: fail (Address does not pass the Sender Policy Framework) SPF=FROM; sender=arch@eckner.net; remoteip=::ffff:141.35.50.156; remotehost=nlopc43.ioq.uni-jena.de; helo=nlopc43.ioq.uni-jena.de; receiver=szilassi.eckner.net; X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 Subject: [arch-projects] [devtools] [PATCH] arch-nspawn should use the correct pacman config file X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: arch--- via arch-projects Reply-To: Arch Linux projects development discussion Cc: arch@eckner.net, Erich Eckner Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" From: Erich Eckner If arch-nspawn is called with -C, pacman inside the chroot will use the provided configuration file. This should also be the case for $pacconf_cmd and pacman outside the chroot. If arch-nspawn is called without -C, pacman inside the chroot will use $workdir/etc/pacman.conf -- again, $pacconf_cmd and pacman outside the chroot should use that, too. So lets just set $pac_conf in that case. For example, Arch Linux 32 provides separate pacman configurations inside /usr/share/devtools which use /etc/pacman.d/mirrorlist32 as mirrorlist for their build commands (extra-i686-build, etc.). This way, we can build i686 and x86_64 packages on the same x86_64 host with very minimal changes to devtools. Signed-off-by: Erich Eckner --- arch-nspawn.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch-nspawn.in b/arch-nspawn.in index e68e2e75..cebeb2ec 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -52,16 +52,17 @@ shift 1 [[ -z $working_dir ]] && die 'Please specify a working directory.' +[[ -z $pac_conf ]] && pac_conf="$working_dir/etc/pacman.conf" + if [[ -z $cache_dir ]]; then - cache_dirs=($(pacman -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g')) + cache_dirs=($(pacman --config "$pac_conf" -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g')) else cache_dirs=("$cache_dir") fi pacconf_cmd=$(command -v pacman-conf || command -v pacconf) # shellcheck disable=2016 -host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#')) -# shellcheck disable=2016 +host_mirrors=($($pacconf_cmd --conf "$pac_conf" --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#')) # {{{ functions build_mount_args() {