Commit c22fe04a authored by Yann E. MORIN's avatar Yann E. MORIN Committed by Thomas Petazzoni
Browse files

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: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: default avatarSamuel Martin <s.martin49@gmail.com>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 8d97ef5d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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

+0 −3
Original line number Diff line number Diff line
@@ -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