From patchwork Mon Jul 2 13:01:53 2018 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: 666 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 45FD1535142A for ; Mon, 2 Jul 2018 13:02:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on apollo X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED=0.1, DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,T_DKIMWL_WL_HIGH=-0.01 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-BL-Results: [127.0.9.2] [127.0.0.10] [127.0.0.10] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Mon, 2 Jul 2018 13:02:24 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 3A97AB88D2FBE; Mon, 2 Jul 2018 13:02:20 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Mon, 2 Jul 2018 13:02:20 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 221342D613; Mon, 2 Jul 2018 13:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1530536540; bh=i2R753nZiUMrXmFHmIKiTZp2w3ZkR4wOX4FeP9CnpYM=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc; b=G3rqct3+MjFHWyImJLQQSgnkEItFhtZt68+Qf6JdzF5oDiWglIFTGycx8rOE46prC w8rR2QO3GgUx54hY1Qth34fOv4PfEaNqENVRMSJptjiZRTxFWjUm+voMYxt+JbWhbi xsgwxAy6Rpia+8bccLsTiy/F4RU68rMB2fTMtL4msfRGkEkjZqu2ZDoN9659uP6zn9 zPTKmycBT7hxb/qCvl5ymtUjC8Tcao7l0Jy9bQBmGXfqjD4zT0sPySMBlSzDWJXDED ypTjpJAr8nx1nDOaPuXjDMYfBW7wgRs/TjVUOWxPH23sPVrNlSD/YmZtIS9RAAUurS 9Y/L9SUTl1DHJ8ZgXzhplCgTPOkOipc0GwB2gdYaw9/sCuAMwhFwxBd21hr3bg6foI v+w9YqCRZX4HnfEWQGZX4DZnLkS3+vQtOOBrZ5oRs/DLnVyCH+TC2CVNCeKbi4JUH5 TlxsM9H6niz7QTna7LjFmMkBGGEE4Hm8RX6/EzkH1oP0Ri76X3uEDZT59pVb5PsuA8 AFNHC6ezX6FAFAIzXi1Ap/24LfRfIStneuBtWzrOEBLfRX51KIOxAlw9ar7dLz7a4j LLzsCJkBxw6SBhVtRJhhoyzh7UZ6NLefXfDr2TPBP99o4Cw55x8+skoaQU+IlgoHDU KmX7RZ7yOvDd5w0dftUci9FE= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 302C32BFCA for ; Mon, 2 Jul 2018 13:02:18 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTP for ; Mon, 2 Jul 2018 13:02:18 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 20564B88D2FAE; Mon, 2 Jul 2018 13:02:12 +0000 (UTC) Received: from localhost.localdomain (ool-44c19a5f.dyn.optonline.net [68.193.154.95]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id 8E3C2B88D2FAD; Mon, 2 Jul 2018 13:02:11 +0000 (UTC) To: arch-projects@archlinux.org Date: Mon, 2 Jul 2018 09:01:53 -0400 Message-Id: <20180702130154.16755-1-eschwartz@archlinux.org> X-Mailer: git-send-email 2.18.0 Subject: [arch-projects] [dbscripts] [PATCH 1/2] db-move: Don't store filepaths as a string with whitespace splitting X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.26 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" Use arrays via nameref, since makepkg does not support multidimensional arrays, and assigning to/retrieving from an array variable with an unknown name requires this. Requires bash 4.3, requires that architectures never contain chars that are invalid in a variable name -- which makepkg explicitly requires in order to support architecture-dependent sources/dependencies, and also incorporates into linting checks which forbid anything but [[:alnum:]_] so that's all good. Signed-off-by: Eli Schwartz --- db-move | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/db-move b/db-move index 63e5c14c..c4da5bf9 100755 --- a/db-move +++ b/db-move @@ -60,8 +60,10 @@ done msg "Moving packages from [%s] to [%s]..." "$repo_from" "$repo_to" -declare -A add_pkgs -declare -A remove_pkgs +for arch in "${ARCHES[@]}"; do + declare -a add_pkgs_$arch + declare -a remove_pkgs_$arch +done for pkgbase in "${args[@]:2}"; do tag_list="" for pkgarch in "${ARCHES[@]}" 'any'; do @@ -95,6 +97,8 @@ for pkgbase in "${args[@]:2}"; do for pkgname in "${pkgnames[@]}"; do for tarch in "${tarches[@]}"; do + declare -n add_pkgs="add_pkgs_${tarch}" + declare -n remove_pkgs="remove_pkgs_${tarch}" pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXTS}) pkgfile="${pkgpath##*/}" @@ -102,8 +106,8 @@ for pkgbase in "${args[@]:2}"; do if [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile}.sig ]]; then ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "${ftppath_to}/${tarch}/" fi - add_pkgs[${tarch}]+="${FTP_BASE}/${PKGPOOL}/${pkgfile} " - remove_pkgs[${tarch}]+="${pkgname} " + add_pkgs+=("${FTP_BASE}/${PKGPOOL}/${pkgfile}") + remove_pkgs+=("${pkgname}") done done fi @@ -113,9 +117,11 @@ for pkgbase in "${args[@]:2}"; do done for tarch in "${ARCHES[@]}"; do - if [[ -n ${add_pkgs[${tarch}]} ]]; then - arch_repo_modify add "${repo_to}" "${tarch}" ${add_pkgs[${tarch}]} - arch_repo_modify remove "${repo_from}" "${tarch}" ${remove_pkgs[${tarch}]} + declare -n add_pkgs="add_pkgs_${tarch}" + declare -n remove_pkgs="remove_pkgs_${tarch}" + if [[ -n ${add_pkgs[@]} ]]; then + arch_repo_modify add "${repo_to}" "${tarch}" "${add_pkgs[@]}" + arch_repo_modify remove "${repo_from}" "${tarch}" "${remove_pkgs[@]}" fi done From patchwork Mon Jul 2 13:01:54 2018 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: 667 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 30226535142F for ; Mon, 2 Jul 2018 13:02:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on apollo X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED=0.1, DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,T_DKIMWL_WL_HIGH=-0.01 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-BL-Results: [127.0.0.10] [127.0.9.2] [127.0.0.10] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Mon, 2 Jul 2018 13:02:28 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id B143DB88D2FD5; Mon, 2 Jul 2018 13:02:22 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Mon, 2 Jul 2018 13:02:22 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 53FAA2D61D; Mon, 2 Jul 2018 13:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1530536540; bh=wZzoYlzeAT+GcYwxiHOfVtvNYjLZS3c5+qBGbE9GN/0=; 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=Mk7sk4uIIcHNw2g1DVva2Bt+kQAW7bb1azKM67qeIEg5TFcswIxAQ9sK6gcde32Ll GR1kodxZymeTsZsWWZQxYx8RAFUnJBJoqRhI97lYr/c1CJf5wyRBliySsINNCMWmRx wxEMKdpFAyJR82Qo4RRifJ7JOE+K8s2n3tdtWb7T4rnnrGcX8LgHWmW8AdxXAMMmal kBkjtcHpEZz5/7MeAbwOPTSc222IVI9w8t255QRoFBfaNpsnWejKBL7rLcVNBfFdm/ UxM4UDKhJC2eGOJ1mMDspM1YoyPFAVfI6hK/rE52lHdDU16QdzODKtQ5NMwF1RfgQZ vGY6mT8JhJSyEe7bG6MKmxmxCsM0U/naL/ZjZxWDBuX12F92z05AnCCQNXnkzVFHcU xoDwn88D54XvWycvgM1zB/AJMxZAcN1vqHySknBzeoZdGpp2AclFdyrMf9TBnTxV+n pbSJcaKD4969LoyBTGEmHickH6SmYplL/pg+47TlmntwaqPUQwhzsyni16hoW84SRh pGEiPCTb+6+Ih+B4/NFCIP9o5JsV67O9mAH0U6oUpALWoPObDXY9MTKjZCi7/jZoKX CM0VQ7kmf63vHkqE9VTS2WQt0sKLAnm4IngyqvknnIrc8yxaWo5HjEIbO1huJ6fNUN bw856DWM/aG8ioabQNEoglOU= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 08FDA2BFCA for ; Mon, 2 Jul 2018 13:02:19 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTP for ; Mon, 2 Jul 2018 13:02:19 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 5F480B88D2FB5; Mon, 2 Jul 2018 13:02:13 +0000 (UTC) Received: from localhost.localdomain (ool-44c19a5f.dyn.optonline.net [68.193.154.95]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id 6D723B88D2FAF; Mon, 2 Jul 2018 13:02:12 +0000 (UTC) To: arch-projects@archlinux.org Date: Mon, 2 Jul 2018 09:01:54 -0400 Message-Id: <20180702130154.16755-2-eschwartz@archlinux.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180702130154.16755-1-eschwartz@archlinux.org> References: <20180702130154.16755-1-eschwartz@archlinux.org> Subject: [arch-projects] [dbscripts] [PATCH 2/2] hoist $tarch handling above $pkgname, since it is more efficient X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.26 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" Signed-off-by: Eli Schwartz --- db-move | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db-move b/db-move index c4da5bf9..b6448898 100755 --- a/db-move +++ b/db-move @@ -95,10 +95,10 @@ for pkgbase in "${args[@]:2}"; do arch_svn rm --force -q "${svnrepo_from}" tag_list+=", $pkgarch" - for pkgname in "${pkgnames[@]}"; do - for tarch in "${tarches[@]}"; do - declare -n add_pkgs="add_pkgs_${tarch}" - declare -n remove_pkgs="remove_pkgs_${tarch}" + for tarch in "${tarches[@]}"; do + declare -n add_pkgs="add_pkgs_${tarch}" + declare -n remove_pkgs="remove_pkgs_${tarch}" + for pkgname in "${pkgnames[@]}"; do pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXTS}) pkgfile="${pkgpath##*/}"