mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
ynh_setup_source: fix buggy checksum mismatch handling, can't compute the sha256sum after we delete the file @_@
This commit is contained in:
parent
b2596f3287
commit
1b2fa91ff0
1 changed files with 4 additions and 2 deletions
|
@ -267,8 +267,10 @@ ynh_setup_source() {
|
||||||
# Check the control sum
|
# Check the control sum
|
||||||
if ! echo "${src_sum} ${src_filename}" | ${src_sumprg} --check --status
|
if ! echo "${src_sum} ${src_filename}" | ${src_sumprg} --check --status
|
||||||
then
|
then
|
||||||
rm ${src_filename}
|
local actual_sum="$(${src_sumprg} ${src_filename} | cut --delimiter=' ' --fields=1)"
|
||||||
ynh_die --message="Corrupt source for ${src_filename}: Expected ${src_sum} but got $(${src_sumprg} ${src_filename} | cut --delimiter=' ' --fields=1) (size: $(du -hs ${src_filename} | cut --delimiter=' ' --fields=1))."
|
local actual_size="$(du -hs ${src_filename} | cut --delimiter=' ' --fields=1)"
|
||||||
|
rm -f ${src_filename}
|
||||||
|
ynh_die --message="Corrupt source for ${src_filename}: Expected ${src_sum} but got ${actual_sum} (size: ${actual_size})."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue