Преглед на файлове

support/download: do not warn about missing hash file for repositories

When downloading from a repository, we explicitly pass no hash file,
because we can't check hashes in that case.

However, we're still printing a message that there is a missign hash
file.

Beside being a bit annoying (since we can't do anything about it), it
may also be wrong, especially for packages for which we support multiple
versions, with some being downloaded via a git clone and others as
tarballs.

Just print no warning when the path to the hash file is empty.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Yann E. MORIN преди 10 години
родител
ревизия
aa3a409b05
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      support/download/check-hash

+ 5 - 1
support/download/check-hash

@@ -31,8 +31,12 @@ h_file="${1}"
 file="${2}"
 file="${2}"
 base="${3}"
 base="${3}"
 
 
+# Bail early if no hash to check
+if [ -z "${h_file}" ]; then
+    exit 0
+fi
 # Does the hash-file exist?
 # Does the hash-file exist?
-if [ -z "${h_file}" -o ! -f "${h_file}" ]; then
+if [ ! -f "${h_file}" ]; then
     printf "WARNING: no hash file for %s\n" "${base}" >&2
     printf "WARNING: no hash file for %s\n" "${base}" >&2
     exit 0
     exit 0
 fi
 fi