From patchwork Mon Jul 2 07:27:05 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: 664 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 0960C53402BE for ; Mon, 2 Jul 2018 07:27:47 +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 [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Mon, 2 Jul 2018 07:27:46 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 2E2BCB8747E54; Mon, 2 Jul 2018 07:27:39 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (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 07:27:39 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 0C1DB2B161; Mon, 2 Jul 2018 07:27:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1530516459; bh=HG2l+ZMJhOFy3vDuZDafYTTl6F2ycDLKpBjlI2rfXiA=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc; b=s0kjMk1YfV4k4b6+ye9i/Yy9wrVa437Gp/uWvZ/iqzFBDANsxqwDHP7awjaQA0OYr f75hqSKtxtKwfscmauPvMvJx7grOkeb3d/CUdF+cgVX3lpO2v1TEdyUQvN/Cza658R KSm2SSOLGRfcCVu28cAwN2+rABkomND/20k97+yVbC3c71/SkF7HAhmrI6nszvXklU Vz4Y4In56aw25gIcSRLcs9rgRbJkNM9qLKEyh5UPctWQFpWGXOL8D5L7S6i1mBDSi0 Aa6Su//MkT+F6O3+TJp5XDMrwVsw7BBmmmsFM1nTPqyLBhXYZg/ouQRcxUpQMa4PHr 1F/0LLvWRrghmfxU05VAw91narcPRwAZy8hMV47KReN78Y68/DfrNys4tN76Y0r53b 7lfa5G2kBGi5XeUbtdGZ+31V2Kn1bNU88+zc453Iu8fxnpbeyB8fQEGzHBcdMw8nke aod3fm2p0HTQmSo8RDwWcbnEWM1xRR4Chsc2pcElPxHhgPOMsL0+HLW7+spKIb4IbF /nIIf+ODxSBnXx/L5CXvqk4tVCh3fDp/mvPYMce+JzEMGaHFfYS368sGPx2cvZqaq0 esORx2d3rkvIYCmKNG6fuTpPShWgNiACTDUhPWCy+BBGX2xxESA4jBR2HSZ8datRC3 0wUl5WW60dfUuDNDgFUgvDPk= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 2FDEE2D3F8 for ; Mon, 2 Jul 2018 07:27:35 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Mon, 2 Jul 2018 07:27:35 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 47770B8747E51 for ; Mon, 2 Jul 2018 07:27:26 +0000 (UTC) Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Mon, 2 Jul 2018 07:27:26 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id D597A20E59 for ; Mon, 2 Jul 2018 09:27:25 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 41JzNY0fbZz9rxK; Mon, 2 Jul 2018 09:27:24 +0200 (CEST) To: arch-projects@archlinux.org Date: Mon, 2 Jul 2018 09:27:05 +0200 Message-Id: <20180702072705.17301-1-michael.straube@posteo.de> X-Mailer: git-send-email 2.18.0 Subject: [arch-projects] [namcap] [PATCH] Add missing support for sha224 sums 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: Michael Straube via arch-projects Reply-To: Arch Linux projects development discussion Cc: Michael Straube Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" Namcap does not support sha224 checksums but makepkg does. Add sha224 support. Signed-off-by: Michael Straube --- Namcap/rules/arrays.py | 2 +- Namcap/rules/extravars.py | 4 ++-- Namcap/rules/missingvars.py | 2 +- parsepkgbuild.sh | 5 +++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Namcap/rules/arrays.py b/Namcap/rules/arrays.py index 243816e..5ca33cc 100644 --- a/Namcap/rules/arrays.py +++ b/Namcap/rules/arrays.py @@ -29,7 +29,7 @@ class package(PkgbuildRule): arrayvars = ['arch', 'license', 'groups', 'depends', 'makedepends', 'optdepends', 'checkdepends', 'provides', 'conflicts', 'replaces', 'backup', 'options', 'source', 'noextract', 'md5sums', 'sha1sums', - 'sha256sums', 'sha384sums', 'sha512sums', 'validpgpkeys'] + 'sha224sums', 'sha256sums', 'sha384sums', 'sha512sums', 'validpgpkeys'] for i in pkginfo.pkgbuild: m = re.match('\s*(.*)\s*=\s*(.*)$', i) for j in arrayvars: diff --git a/Namcap/rules/extravars.py b/Namcap/rules/extravars.py index df0c0bf..a10a878 100644 --- a/Namcap/rules/extravars.py +++ b/Namcap/rules/extravars.py @@ -26,8 +26,8 @@ class package(PkgbuildRule): description = "Verifies that extra variables start with an underscore" def analyze(self, pkginfo, tar): carch_vars = ['checkdepends', 'conflicts', 'depends', 'makedepends', - 'optdepends', 'provides', 'replaces', 'source', 'md5sums', - 'sha1sums', 'sha256sums', 'sha384sums', 'sha512sums'] + 'optdepends', 'provides', 'replaces', 'source', 'md5sums', + 'sha224sums', 'sha1sums', 'sha256sums', 'sha384sums', 'sha512sums'] stdvars = ['arch', 'license', 'backup', 'noextract', 'pkgname', 'pkgbase', 'pkgver', 'pkgrel', 'epoch', 'pkgdesc', 'groups', 'url', 'install', 'changelog', diff --git a/Namcap/rules/missingvars.py b/Namcap/rules/missingvars.py index 2b8811c..25445e2 100644 --- a/Namcap/rules/missingvars.py +++ b/Namcap/rules/missingvars.py @@ -30,7 +30,7 @@ class ChecksumsRule(PkgbuildRule): name = "checksums" description = "Verifies checksums are included in a PKGBUILD" def analyze(self, pkginfo, tar): - checksums=[('md5', 32), ('sha1', 40), ('sha256', 64), ('sha384', 96), ('sha512', 128)] + checksums=[('md5', 32), ('sha1', 40), ('sha224', 56), ('sha256', 64), ('sha384', 96), ('sha512', 128)] if "source" in pkginfo: haschecksums = False diff --git a/parsepkgbuild.sh b/parsepkgbuild.sh index 12874f3..a158d1e 100644 --- a/parsepkgbuild.sh +++ b/parsepkgbuild.sh @@ -109,6 +109,11 @@ if [ -n "$sha1sums" ]; then for i in "${sha1sums[@]}"; do echo $i; done echo "" fi +if [ -n "$sha224sums" ]; then + echo "%SHA224SUMS%" + for i in "${sha224sums[@]}"; do echo $i; done + echo "" +fi if [ -n "$sha256sums" ]; then echo "%SHA256SUMS%" for i in "${sha256sums[@]}"; do echo $i; done