From patchwork Tue Jun 12 13:59:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Schwartz X-Patchwork-Id: 608 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 8A0954C7C22F for ; Tue, 12 Jun 2018 14:00:06 +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] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Tue, 12 Jun 2018 14:00:06 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id BD493B2917C97; Tue, 12 Jun 2018 14:00:02 +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; Tue, 12 Jun 2018 14:00:02 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 43C7D20935; Tue, 12 Jun 2018 14:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1528812002; bh=ZGmVUvStO0EvYxEWzNdH5EPHLiJDNB4K+cs6UKN/y+M=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Reply-To; b=qE5jmHRKT3klW5H34P7wcCJU8+zxFzew8oc3hoXTsLmwWdOFIdQFfvrI8c8G1mUkJ ORl7pK7gPcxBcTEhNFpHx7xqm3Y7XwxjIt58VBrEkU0jlX1Z/IqwL3MRJ1AacKoWa5 Y1NxbKA2vibHbU5ErASYb6gHfTaT4FYqNYUFpwweT0jlzSmraSupOK+DeIdlAt10Xp chaDvPQcZg6/OyHRWNsN3Cx0wvehOzqMJLOUmRYXrEbOwmV27Jqn+kYC18Tj4cSFi2 VCHsHZqE5PT1CvwfiHsX65JCuKyIIb0viC5ELcuPjl8CPofSUnBxp3mFHKN54pe3cM NvS+kWgVLwbSAPxk5p8Z/TBk1jark2pUKe/tAQ7Mcepbywys0WF+UcALE1SUaRcGQY 1XeEIn2KlllJQqUALzqrzJsWayrl2Su4dYkSFV71CtkRe37pMJyzcvFwE/AsDS5x64 TzKDHJSySVcuBUvsNMnlicFj0k/+UfrgNQvnh/xwJcjvKlbeFjKHXTmpVcRPQb4wk/ AzoNWip/L2Gd3D8GGZqOg7CNuJpUPJ+i1VLrFG3LfLcwEyD6sDb1d4d4ICw1z8gj37 uIS64wC1hGSKNSew9ZB5aOp3ixRJ4C6euzyQbD30cHinnN53rb6vghFcQNjPAq0IzF bsLO7O5AQQNo4KKQftRay9JQ= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id BF1D42D1A4 for ; Tue, 12 Jun 2018 13:59:58 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Tue, 12 Jun 2018 13:59:58 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id D6535B2917C92; Tue, 12 Jun 2018 13:59:52 +0000 (UTC) Received: from didactylos.localdomain (unknown [216.97.144.179]) (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 682ECB2917C91; Tue, 12 Jun 2018 13:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1528811992; bh=ZGmVUvStO0EvYxEWzNdH5EPHLiJDNB4K+cs6UKN/y+M=; h=From:To:Subject:Date:In-Reply-To:References; b=MKZwU7v+mGEiQDSWkGSUtx28AxtvUQWTth5ovvpXLV/Xr4FIG2Vqu0Kj5jB16b1ct 9vv0uqhw7Fv90F+Wwbhlk7nc1ed5r7Pnc88r/1qsmqkA/TeUq+Jeox1KtAtwiTr/AM zP/KgNpbT/X/JisUHx68bAnIRrfzjfFh5fBB3g9mNo7TjaVLre10wPbtOyFdhj0Q8T /Hp+FKKP/8LcqYdW5B2hxJWiCQkjunEXHBTxscO49jVps5A3K1MKwIbmumxTHD5iaE s+QNigiW5+Ph6f9nj96GiVW/lDpg7zZa7tIKOtHiqVEw+LuDLsZ4pdmz25Gc1+hko8 B7BKZ/NgVOR7o9O6UE87yuo15ZNXb3BA6E3jeIaQXVNWbujKzsJt8GXBeLBnFsT1sQ QM8gakHl0zMyMHyR20M/6VhBahIyBOi7Lwo0czx2wmLBculTuBVnGyAtzTvIUiYePO 6yr1ZUrBtTatMQmrI832bcM9oPQBqc7nIQGyY/kuOgmHZ4NZzGb7SGNVaQaiZt2cBz dYa9LhAerayarfw0ML8rSqS66JNfbsucybSPPianEpqugvkTG5oqAStHnuOJbZrN2R T9KjX/YEhcyvQH/KsngeT5V5DzF2O125XTHdEcrMML3hd7lcK2Iz/AhwXlxMPExkej u+OX5vpScj9yAn+lNZ+YTqUk= From: Eli Schwartz To: pacman-dev@archlinux.org Date: Tue, 12 Jun 2018 09:59:54 -0400 Message-Id: <20180612135954.25614-1-eschwartz@archlinux.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612134106.njdd2tawyazgd74a@rampage> References: <20180612134106.njdd2tawyazgd74a@rampage> Subject: [pacman-dev] [PATCH v2] libmakepkg/integrity: use more shared functions to generate signatures X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.26 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 newly changed print_all_package_names function can iterate over the list of all package files that will be created; this avoids the need to independently recreate those filenames here. Additionally, since debug packages may not actually exist, check if the package file exists first. If the main package does not exist then makepkg will have aborted before now, so there is no need to special-case that here. Signed-off-by: Eli Schwartz --- v2: forgot to use -r in read .../integrity/generate_signature.sh.in | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/scripts/libmakepkg/integrity/generate_signature.sh.in b/scripts/libmakepkg/integrity/generate_signature.sh.in index 442fe031..261b18f7 100644 --- a/scripts/libmakepkg/integrity/generate_signature.sh.in +++ b/scripts/libmakepkg/integrity/generate_signature.sh.in @@ -50,25 +50,12 @@ create_package_signatures() { if [[ $SIGNPKG != 'y' ]]; then return 0 fi - local pkg pkgarch pkg_file - local fullver=$(get_full_version) msg "$(gettext "Signing package(s)...")" - for pkg in "${pkgname[@]}"; do - pkgarch=$(get_pkg_arch $pkg) - pkg_file="$PKGDEST/${pkg}-${fullver}-${pkgarch}${PKGEXT}" - - create_signature "$pkg_file" - done - - # check if debug package needs a signature - if ! check_option "debug" "y" || ! check_option "strip" "y"; then - pkg=$pkgbase-@DEBUGSUFFIX@ - pkgarch=$(get_pkg_arch) - pkg_file="$PKGDEST/${pkg}-${fullver}-${pkgarch}${PKGEXT}" + print_all_package_names | while read -r pkg_file; do if [[ -f $pkg_file ]]; then create_signature "$pkg_file" fi - fi + done }