Browse Source

Check for file existence before trying sha256_verify

master
Kristaps Kaupe 5 years ago
parent
commit
0fb0cb96c4
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 2
      install.sh
  2. 2
      test/run_tests.sh

2
install.sh

@ -144,7 +144,7 @@ dep_get ()
pkg_name="$1" pkg_hash="$2" pkg_url="$3"
pushd cache
if ! sha256_verify "${pkg_hash}" "${pkg_name}"; then
if [ ! -f "${pkg_name}" ] || ! sha256_verify "${pkg_hash}" "${pkg_name}"; then
http_get "${pkg_url}/${pkg_name}" "${pkg_name}"
fi
if ! sha256_verify "${pkg_hash}" "${pkg_name}"; then

2
test/run_tests.sh

@ -46,7 +46,7 @@ run_jm_tests ()
export C_INCLUDE_PATH="${C_INCLUDE_PATH}:${VIRTUAL_ENV}/include"
pushd "${jm_source}"
if ! sha256_verify 'ce3a4ddc777343645ccd06ca36233b5777e218ee89d887ef529ece86a917fc33' 'miniircd.tar.gz'; then
if [ ! -f 'miniircd.tar.gz' ] || ! sha256_verify 'ce3a4ddc777343645ccd06ca36233b5777e218ee89d887ef529ece86a917fc33' 'miniircd.tar.gz'; then
http_get "https://github.com/JoinMarket-Org/miniircd/archive/master.tar.gz" "miniircd.tar.gz"
fi
if [[ ! -x ${jm_source}/miniircd/miniircd ]]; then

Loading…
Cancel
Save