support/download: return different exit codes for different failures
authorYann E. MORIN <yann.morin.1998@free.fr>
Tue, 31 Mar 2015 22:15:04 +0000 (00:15 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 3 Apr 2015 12:08:50 +0000 (14:08 +0200)
commit0012b36c148dcd9a68d16a24168dee464beb2da9
treea9cff444586334a0e67bf29f590532be899df525
parent1ba85b7f874d926412eb4687e303cea441d65fec
support/download: return different exit codes for different failures

Return different exit codes depending on the error that occured:

  0: no error (hash file missing, or all hashes match)
  1: unknown option
  2: hash file exists, but at least one hash in error
  3: hash file exists, but no hash for file to check
  4: hash file exists, but at least one hash type unknown

This will be used in a later patch to decide whether the downloaded file
should be kept or removed.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Samuel Martin <s.martin49@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/download/check-hash