summaryrefslogtreecommitdiff
path: root/support/download
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2015-04-01 00:15:01 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-04-03 14:08:00 +0200
commitc22fe04a789ef59add62612d1c5ceeadccd4e3ef (patch)
tree057c5c9ec4d14db842d8fcc3589221fb4602dac5 /support/download
parent8d97ef5d7c29c1def0b7e7529612a8c60fb6156f (diff)
support/download: make hash file optional
Currently, specifying a hash file for our download wrapper is mandatory. However, when we download a git, svn, bzr, hg or cvs tree, there's by design no hash to check the download against. Since we're going to have hash checking mandatory when a hash file exists, this would break those downloads from a repository. So, make specifying a hash file optional when calling our download wrapper and bail out early from the check-hash script if no hash file is specified. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support/download')
-rwxr-xr-xsupport/download/check-hash2
-rwxr-xr-xsupport/download/dl-wrapper3
2 files changed, 1 insertions, 4 deletions
diff --git a/support/download/check-hash b/support/download/check-hash
index 4c07274cc..cee64ef31 100755
--- a/support/download/check-hash
+++ b/support/download/check-hash
@@ -23,7 +23,7 @@ file="${2}"
base="${3}"
# Does the hash-file exist?
-if [ ! -f "${h_file}" ]; then
+if [ -z "${h_file}" -o ! -f "${h_file}" ]; then
exit 0
fi
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 3b30840a0..514118c57 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -44,9 +44,6 @@ main() {
if [ -z "${output}" ]; then
error "no output specified, use -o\n"
fi
- if [ -z "${hfile}" ]; then
- error "no hash-file specified, use -H\n"
- fi
# If the output file already exists, do not download it again
if [ -e "${output}" ]; then