Ver código fonte

support/download: drop support for the 'none' hash

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 <yann.morin.1998@free.fr>
[Thomas: drop support in checkpackagelib, as reported by Ricardo.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Yann E. MORIN 3 anos atrás
pai
commit
5da8218184

+ 1 - 8
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:
 hash, each line with the following three fields separated by two spaces:
 
 
 * the type of hash, one of:
 * the type of hash, one of:
-** +md5+, +sha1+, +sha224+, +sha256+, +sha384+, +sha512+, +none+
+** +md5+, +sha1+, +sha224+, +sha256+, +sha384+, +sha512+
 * the hash of the file:
 * the hash of the file:
-** for +none+, one or more non-space chars, usually just the string +xxx+
 ** for +md5+, 32 hexadecimal characters
 ** for +md5+, 32 hexadecimal characters
 ** for +sha1+, 40 hexadecimal characters
 ** for +sha1+, 40 hexadecimal characters
 ** for +sha224+, 56 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 +<packageversion>+ of that package
 create the hash file in a subdirectory +<packageversion>+ of that package
 (see also xref:patch-apply-order[]).
 (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 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
 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
 locally-computed +sha256+ hashes for a binary blob, a +sha256+ for a
@@ -520,9 +516,6 @@ sha256  01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b  libfoo
 # Locally computed:
 # Locally computed:
 sha256  ff52101fb90bbfc3fe9475e425688c660f46216d7e751c4bbdb1dc85cdccacb9  libfoo-fix-blabla.patch
 sha256  ff52101fb90bbfc3fe9475e425688c660f46216d7e751c4bbdb1dc85cdccacb9  libfoo-fix-blabla.patch
 
 
-# No hash for 1234:
-none  xxx  libfoo-1234.tar.gz
-
 # Hash for license files:
 # Hash for license files:
 sha256  a45a845012742796534f7e91fe623262ccfb99460a2bd04015bd28d66fba95b8  COPYING
 sha256  a45a845012742796534f7e91fe623262ccfb99460a2bd04015bd28d66fba95b8  COPYING
 sha256  01b1f9f2c8ee648a7a596a1abe8aa4ed7899b1c9e5551bda06da6e422b04aa55  doc/COPYING.LGPL
 sha256  01b1f9f2c8ee648a7a596a1abe8aa4ed7899b1c9e5551bda06da6e422b04aa55  doc/COPYING.LGPL

+ 0 - 4
support/download/check-hash

@@ -53,11 +53,7 @@ check_one_hash() {
     # Note: md5 is supported, but undocumented on purpose.
     # Note: md5 is supported, but undocumented on purpose.
     # Note: sha3 is not supported, since there is currently no implementation
     # Note: sha3 is not supported, since there is currently no implementation
     #       (the NIST has yet to publish the parameters).
     #       (the NIST has yet to publish the parameters).
-    # Note: 'none' means there is explicitly no hash for that file.
     case "${_h}" in
     case "${_h}" in
-        none)
-            return 0
-            ;;
         md5|sha1)                       ;;
         md5|sha1)                       ;;
         sha224|sha256|sha384|sha512)    ;;
         sha224|sha256|sha384|sha512)    ;;
         *) # Unknown hash, exit with error
         *) # Unknown hash, exit with error

+ 0 - 2
utils/checkpackagelib/lib_hash.py

@@ -41,8 +41,6 @@ class HashType(_CheckFunction):
             return
             return
 
 
         htype, hexa = fields[:2]
         htype, hexa = fields[:2]
-        if htype == "none":
-            return
         if htype not in self.len_of_hash.keys():
         if htype not in self.len_of_hash.keys():
             return ["{}:{}: unexpected type of hash ({}#adding-packages-hash)"
             return ["{}:{}: unexpected type of hash ({}#adding-packages-hash)"
                     .format(self.filename, lineno, self.url_to_manual),
                     .format(self.filename, lineno, self.url_to_manual),