Print size in error message if ynh_setup_source checksum fails

Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
tituspijean 2023-01-31 18:07:25 +01:00 committed by GitHub
parent 90aa55599d
commit 7dd2b41eef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,7 +167,7 @@ ynh_setup_source() {
|| ynh_die --message="$out"
# Check the control sum
echo "${src_sum} ${src_filename}" | ${src_sumprg} --check --status \
|| ynh_die --message="Corrupt source for ${src_filename}: Expected ${src_sum} but got $(${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))."
fi
# Keep files to be backup/restored at the end of the helper