From patchwork Tue Feb 11 00:41:37 2020 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: 1505 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 0B0C816FA76FA for ; Tue, 11 Feb 2020 00:42:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=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_LOW=-0.7,SPF_HELO_NONE=0.001, T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.9.1] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Tue, 11 Feb 2020 00:42:13 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id D5EB418D230B52; Tue, 11 Feb 2020 00:42:11 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (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 670F518D230B4B; Tue, 11 Feb 2020 00:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1581381731; bh=/LFIy5FuCoDsYnR65Wy3TK9puxeLnoohHcQ4b7RIgSQ=; 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=PvCVMdr4OLlYpkony71x+iQH/B8KHAo3mrZnAlISIjTEM7mRxzyKO/Ma7HofWh5vj t00eyOkTDhmTByDx2XxM3qwO5DMhV7pIX6T75yWdTWnXXN7TU+V7oy+q3tWUJN/P5f TcEpPvp/GugPMJ8RP7J9mBa90q8hl+f7n2ejTpBjUuecrwiKYkwih8D1WsXEuNqDMv OH+0ZFlqbYl8yABPdD6I127+R3+bxvSdYeDEn6ASGeHiZQCJv2MoDNB3nOEEBvpT3a PZeM+75Zw2LAxjOmiXAJlk2vQtK5JE4whukDAdxofUjO3rQyUuoc/IqnmuqFp4EvCY R41YnhmTd3mniL9bIB6JfR/1DmhFTVrbqQDLfQtC98Ra854R1pGtHpaTe+uJoKeMau L67Bc4djLVD/qJtJVOS4keYjR4fnwq0IUXEpeutjDz2mFKbxwgphbUiKwgie3IW/KN WDC9LEmoyqtmq/tO93zyK2YHmYeNe/TFVaLpmQpkGUgWhConvWssswTQL8+x/GG3ch hENk5x/4U61OMjeyvgGc3H96tyJJAKtbCyvWzMz2/CBmfjl48W08g+kpmHghMf/Evp qhWarZ53XQLjnXK+5zOg2aLpp7CEbIGK/B1BC7WJaT93xVix/rTYIFCAurAXSmLvk5 zXW+i5fD1yYfjdH1PlzmE5dY= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 5A95E2BE4F; Tue, 11 Feb 2020 00:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1581381731; bh=/LFIy5FuCoDsYnR65Wy3TK9puxeLnoohHcQ4b7RIgSQ=; 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=FMEcyRZ5v6HKckrRSwXpiyQde9DfgN8l9sZtLNLfvVdRJq52FvhyJcG/g02kWomEG 0gAMs/pWz3LVtMukoDYdY0e1R/cLAIHUFY94v3CPgAZLOp23ZPy/Vw3AR1ZTwT+l7S kgQ/1KIIKVKJu3hvnbzsZLcnCIOSl9zgKCtEWRCPKywQkJC9R/M0dGgOczHW/TU3CW KF36BFJxIDDT+zVqV5/CfhgbTA40hTnQJ/j7V24L4hZjYdW6bmhDVK14+evnc5sQ7H lVtoXvi2kgYMhHS3qqAtErpC1iCryTpgkbNfpG6AQrbhstO+E+E+ecAQiXFtkHhfFy OqFMAHtL9JW1/5VELdgK84u1rFzZUl02OuK9BbnYWlWflQujdayWsfASjkm88G4a5t SlaZGhAkOibGnBYWp99w0L9nNIRtSXIlo7AHZ4AFsSf27orE8xYkVNywJV8Kng0kod T0AbXvUED0jo8M7Ez+DQ20NhHpCfdkLJRW/Z5UQEalRTh2DGt0rdC45DN0/oWIaWXC 1GQeLvPzm1w+auo8DXKRxGBDJ7BnS35JsGseCslx00g2ZKGYB+pZwrZLGsOABREzmo TS6cfmgjeyRi61IcYLGVtCzSjcXNwXMw42lbnyY8XH/uLIDPaAiJJmLwCtQ74cNOtp TMZ2QCLsKFdK+wbafvdIkwNM= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id B83B42BA6A for ; Tue, 11 Feb 2020 00:42:06 +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, 11 Feb 2020 00:42:06 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 49C2618D2232C5; Tue, 11 Feb 2020 00:41:57 +0000 (UTC) Received: from didactylos.attlocal.net (unknown [IPv6:2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) (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) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id 85F9918D2232B9; Tue, 11 Feb 2020 00:41:52 +0000 (UTC) To: arch-projects@archlinux.org Date: Mon, 10 Feb 2020 19:41:37 -0500 Message-Id: <20200211004137.2677730-1-eschwartz@archlinux.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200204195355.384821-1-eschwartz@archlinux.org> References: <20200204195355.384821-1-eschwartz@archlinux.org> MIME-Version: 1.0 Subject: [arch-projects] [devtools] [PATCH v2] arch-nspawn: fix up host_mirrors cachedir handling 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: Eli Schwartz via arch-projects Reply-To: Arch Linux projects development discussion Cc: Eli Schwartz Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" This was incorrectly implemented in commit 00671765296ad598f392df7a542dbfca48a6e7b7, which added the host_mirrors root directory as a cachedir, when we actually want to use the pool/* subdirectories (the same ones installed on the build server's /etc/pacman.conf). Signed-off-by: Eli Schwartz --- v2: add paths with trailing "/", for consistency and to make sure we only try to match directories (though no file should ever be there). arch-nspawn.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch-nspawn.in b/arch-nspawn.in index 198d227..cde1f60 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -69,7 +69,9 @@ host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#(.*/)e for host_mirror in "${host_mirrors[@]}"; do if [[ $host_mirror == *file://* ]]; then host_mirror=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g') - in_array "$host_mirror" "${cache_dirs[@]}" || cache_dirs+=("$host_mirror") + for m in "$host_mirror"/pool/*/; do + in_array "$m" "${cache_dirs[@]}" || cache_dirs+=("$m") + done fi done