From 5da82181846b81a967c48f02f7404812a8acd60a Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Mon, 10 Jan 2022 17:23:19 +0100 Subject: [PATCH] support/download: drop support for the 'none' hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 1ba85b7f874d (support/download: add explicit no-hash support) introduced the 'none' hash type, in an attempt to make hash files mandatory, but not failing on archives localy generated, like those for git or svn repositories, especially for those packages where a version choice was present, which would allow for either remote archives for which we'd have a hash or VCS trees for which we could not have a hash for the localy generated archive. Indeed, back in the time, we did not have a mean to generate reproducible archives, so having a hash file without a hash for thosel ocally generated archives would trigger an error in the hash-checking machinery. But now, low-and-behold, we do know how to generate those archives, and we have a mechanism to explicitly exclude some archives from being hash-checked (e.g. when the version string itself can be user-provided). As such, the 'none' hash type no longer has any raison d'ĂȘtre, we do not use it in-tree, and its use in a br2-external tree is most probably inexistent (as is the use of hash files alotgether most probably). So we simply drop the support for that. Signed-off-by: Yann E. MORIN [Thomas: drop support in checkpackagelib, as reported by Ricardo.] Signed-off-by: Thomas Petazzoni --- docs/manual/adding-packages-directory.txt | 9 +-------- support/download/check-hash | 4 ---- utils/checkpackagelib/lib_hash.py | 2 -- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/docs/manual/adding-packages-directory.txt b/docs/manual/adding-packages-directory.txt index 4ceb3fd772..6c68d7aa67 100644 --- a/docs/manual/adding-packages-directory.txt +++ b/docs/manual/adding-packages-directory.txt @@ -464,9 +464,8 @@ The format of this file is one line for each file for which to check the hash, each line with the following three fields separated by two spaces: * the type of hash, one of: -** +md5+, +sha1+, +sha224+, +sha256+, +sha384+, +sha512+, +none+ +** +md5+, +sha1+, +sha224+, +sha256+, +sha384+, +sha512+ * the hash of the file: -** for +none+, one or more non-space chars, usually just the string +xxx+ ** for +md5+, 32 hexadecimal characters ** for +sha1+, 40 hexadecimal characters ** for +sha224+, 56 hexadecimal characters @@ -500,9 +499,6 @@ target run. For a package with multiple versions (like Qt5), create the hash file in a subdirectory ++ of that package (see also xref:patch-apply-order[]). -The +none+ hash type is reserved to those archives downloaded from a -repository, like a 'git clone', a 'subversion checkout'... - The example below defines a +sha1+ and a +sha256+ published by upstream for the main +libfoo-1.2.3.tar.bz2+ tarball, an +md5+ from upstream and a locally-computed +sha256+ hashes for a binary blob, a +sha256+ for a @@ -520,9 +516,6 @@ sha256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b libfoo # Locally computed: sha256 ff52101fb90bbfc3fe9475e425688c660f46216d7e751c4bbdb1dc85cdccacb9 libfoo-fix-blabla.patch -# No hash for 1234: -none xxx libfoo-1234.tar.gz - # Hash for license files: sha256 a45a845012742796534f7e91fe623262ccfb99460a2bd04015bd28d66fba95b8 COPYING sha256 01b1f9f2c8ee648a7a596a1abe8aa4ed7899b1c9e5551bda06da6e422b04aa55 doc/COPYING.LGPL diff --git a/support/download/check-hash b/support/download/check-hash index fe9c10570e..5a47f49bc3 100755 --- a/support/download/check-hash +++ b/support/download/check-hash @@ -53,11 +53,7 @@ check_one_hash() { # Note: md5 is supported, but undocumented on purpose. # Note: sha3 is not supported, since there is currently no implementation # (the NIST has yet to publish the parameters). - # Note: 'none' means there is explicitly no hash for that file. case "${_h}" in - none) - return 0 - ;; md5|sha1) ;; sha224|sha256|sha384|sha512) ;; *) # Unknown hash, exit with error diff --git a/utils/checkpackagelib/lib_hash.py b/utils/checkpackagelib/lib_hash.py index 698d24fd6b..1c595e84b8 100644 --- a/utils/checkpackagelib/lib_hash.py +++ b/utils/checkpackagelib/lib_hash.py @@ -41,8 +41,6 @@ class HashType(_CheckFunction): return htype, hexa = fields[:2] - if htype == "none": - return if htype not in self.len_of_hash.keys(): return ["{}:{}: unexpected type of hash ({}#adding-packages-hash)" .format(self.filename, lineno, self.url_to_manual),