From patchwork Wed Jun 3 08:12:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1302855 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=BUmgAKM5; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49cMDJ6pv9z9sTD for ; Wed, 3 Jun 2020 18:15:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 861CA203FE; Wed, 3 Jun 2020 08:15:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wd2Z2tBbqlsE; Wed, 3 Jun 2020 08:15:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id C0BA7204A9; Wed, 3 Jun 2020 08:15:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AEA7E1BF4DD for ; Wed, 3 Jun 2020 08:15:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A97638770B for ; Wed, 3 Jun 2020 08:15:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BQ8cyKM0CJCG for ; Wed, 3 Jun 2020 08:15:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id DCBB1876BB for ; Wed, 3 Jun 2020 08:15:35 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id q11so1324890wrp.3 for ; Wed, 03 Jun 2020 01:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/xOLhmjIlEpI0mWwp7tWM4S28EsKTli55ThwmZrROHE=; b=BUmgAKM50xeEQqe/Nkcy4Vy0bH7Hz8cpdH+RsF3wux7+T9gxhO+uFJcCkeTP+yru6U 7Q0CuMOYRB+ITQMaGvBtC/ibywiplitIEuYMxEILoLUlPUceTdBaKImIquYk0NrLbZ4n aT8+YvvNyfYkYTkRkiXJUP4V1uGykJmdf0mc3Tmx6xc28pFiN3d9WaSqOnLgTRI5TErt 67LTbpa7tKZX7K989M+TUS0j1ctd/ItDZz0B02P0UGTu/4hNQvm6+8YMYmBdrUxz36VE PJy7nR+cZxDfZHW8p9VWEMF1P7kVfDEJsJ962V88y29ZZ+GlLxtiRalORs91qiOm4gfk gzqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/xOLhmjIlEpI0mWwp7tWM4S28EsKTli55ThwmZrROHE=; b=JTLaWtsUgImGBvXaDMcOXkcv6hw99zJq7UOkn51yp5VK63PXrBtFGqi73uumDuzwDG g+57l8omLrP+z61bb3e3j7hje+QtRennvsGtedSskQLW+1I6g5EMmbZ8MKbw2oNVA6lF Dvp/RBsusH/mzujUEYXK1+aRN+5Rp9XxZXrnAbqEwfryNfcGlGZ3cfRAI9hltwSsAhuu rfpp81YCzNt0wTztBvOdxZkxFyTQjQW1dO30kptEDWNps39S5wdiLZZaouCbt43qKsaP uHanb3n5BthMuXFxYZo0CqWpwTYVYGvz/noj+91aFk7/pelR/e3qibuP5Xv64YV5K7kO yjfA== X-Gm-Message-State: AOAM53253lhP/2Lm4yK5yrap9jbQjDFImHbiBB68O6Pc79XI4lux5Bs1 vScx3nukbLqY9jj0nuqII4omGw+T X-Google-Smtp-Source: ABdhPJxQKY48MDI4QZQNA3YmmQTE/Kt50xj+7bzHAKxSb90K6FhtB5f1pOIOtaSoDldLIAFIe5BVLw== X-Received: by 2002:adf:f208:: with SMTP id p8mr26783272wro.388.1591172133867; Wed, 03 Jun 2020 01:15:33 -0700 (PDT) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id z2sm2067966wrs.87.2020.06.03.01.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 01:15:32 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Wed, 3 Jun 2020 10:12:53 +0200 Message-Id: <20200603081253.14319-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 1/1] utils/check-package: add a check for the new spacing convention X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Thiery , "Yann E . MORIN" , Thomas Petazzoni , Ricardo Martincoski Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The seperation of the fields in the hash file should be 2 spaces for consistency. Signed-off-by: Heiko Thiery Cc: Yann E. MORIN Cc: Thomas Petazzoni --- v1 -> v2: removed re.escape() v2 -> v3: re-add re.escape and removed '^' and '$' from regexp because they also are escaped by re.escape(). Now 'make check-package' will not throw any exceptions. After conversion all hash files to the right format no more warnings will occure: Oneliner provided by Yann will do that job: $ find . -type f -name '*.hash' -print0 |xargs -0 sed -r -i -e 's/^(md5|sha(1|224|256|384|512))[[:space:]]+([^[:space:]]+)[[:space:]]+(.+)$/\1 \3 \4/' --- utils/checkpackagelib/lib_hash.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/checkpackagelib/lib_hash.py b/utils/checkpackagelib/lib_hash.py index 3e381119a5..a72e8af0b9 100644 --- a/utils/checkpackagelib/lib_hash.py +++ b/utils/checkpackagelib/lib_hash.py @@ -40,7 +40,7 @@ class HashType(_CheckFunction): if len(fields) < 2: return - htype, hexa = fields[:2] + htype, hexa, filename = fields[:3] if htype == "none": return if htype not in self.len_of_hash.keys(): @@ -53,3 +53,7 @@ class HashType(_CheckFunction): .format(self.filename, lineno, self.url_to_manual), text, "expected {} hex digits".format(self.len_of_hash[htype])] + if not re.match(re.escape("{} {} {}".format(htype, hexa, filename)), text): + return ["{}:{}: separation does not match expectation " + "({}#adding-packages-hash)" + .format(self.filename, lineno, self.url_to_manual), text]