diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-10-30 16:36:50 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-10-30 16:36:50 (EDT) |
commit | 717e6191911c1cbec9acf889d36a4a1c53f1ad60 (patch) | |
tree | 798c1d009c1b683ba8bd47dab05bdf00c90cd7af | |
parent | f76bad03285118c06475c98d1d1c35263202e8a4 (diff) | |
download | firman.sh-717e6191911c1cbec9acf889d36a4a1c53f1ad60.zip firman.sh-717e6191911c1cbec9acf889d36a4a1c53f1ad60.tar.gz firman.sh-717e6191911c1cbec9acf889d36a4a1c53f1ad60.tar.bz2 |
dist_get_rom(): Finish error handling
-rw-r--r-- | src/dist/libiquity.sh | 6 | ||||
-rw-r--r-- | src/dist/libreboot.sh | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/dist/libiquity.sh b/src/dist/libiquity.sh index d4fced8..fa52787 100644 --- a/src/dist/libiquity.sh +++ b/src/dist/libiquity.sh @@ -93,6 +93,7 @@ dist_libiquity_get_rom_taurinus_201506() if ! sum="$(dl_temp "${mirror}/${version}/SHA512SUMS" 'sums')"; then err 'Failed to download checksums' rm_temp 'sums' + return 1 fi sum="$(grep -F " ./rom/${archive}" "${sum}" | cut -d ' ' -f 1)" if ! archive="$(dl_temp "${mirror}/${version}/rom/${archive}" \ @@ -100,6 +101,7 @@ dist_libiquity_get_rom_taurinus_201506() err 'Failed to download ROMs archive' rm_temp 'sums' rm_temp 'roms' + return 1 fi # Verify checksum. @@ -137,6 +139,7 @@ dist_libiquity_get_rom_taurinus_201506() rm_temp 'sums' rm_temp 'roms' rm_temp 'rom' + return 1 fi rm_temp 'sums' @@ -164,6 +167,7 @@ dist_libiquity_get_rom_current() if ! sum="$(dl_temp "${mirror}/${version}/SHA512SUMS" 'sums')"; then err 'Failed to download checksums' rm_temp 'sums' + return 1 fi sum="$(grep -F " ./rom/grub/${archive}" "${sum}" | cut -d ' ' -f 1)" if ! archive="$(dl_temp "${mirror}/${version}/rom/grub/${archive}" \ @@ -171,6 +175,7 @@ dist_libiquity_get_rom_current() err 'Failed to download ROMs archive' rm_temp 'sums' rm_temp 'roms' + return 1 fi # Verify checksum. @@ -208,6 +213,7 @@ dist_libiquity_get_rom_current() rm_temp 'sums' rm_temp 'roms' rm_temp 'rom' + return 1 fi rm_temp 'sums' diff --git a/src/dist/libreboot.sh b/src/dist/libreboot.sh index 00d53ca..ad3155d 100644 --- a/src/dist/libreboot.sh +++ b/src/dist/libreboot.sh @@ -104,6 +104,7 @@ dist_libreboot_get_rom_20150518() if ! sum="$(dl_temp "${mirror}/${version}/sha512sum.txt" 'sums')"; then err 'Failed to download checksums' rm_temp 'sums' + return 1 fi sum="$(grep -F " ./rom/${archive}" "${sum}" | cut -d ' ' -f 1)" if ! archive="$(dl_temp "${mirror}/${version}/rom/${archive}" \ @@ -111,6 +112,7 @@ dist_libreboot_get_rom_20150518() err 'Failed to download ROMs archive' rm_temp 'sums' rm_temp 'roms' + return 1 fi # Verify checksum. @@ -148,6 +150,7 @@ dist_libreboot_get_rom_20150518() rm_temp 'sums' rm_temp 'roms' rm_temp 'rom' + return 1 fi rm_temp 'sums' @@ -175,6 +178,7 @@ dist_libreboot_get_rom_current() if ! sum="$(dl_temp "${mirror}/${version}/SHA512SUMS" 'sums')"; then err 'Failed to download checksums' rm_temp 'sums' + return 1 fi sum="$(grep -F " ./rom/grub/${archive}" "${sum}" | cut -d ' ' -f 1)" if ! archive="$(dl_temp "${mirror}/${version}/rom/grub/${archive}" \ @@ -182,6 +186,7 @@ dist_libreboot_get_rom_current() err 'Failed to download ROMs archive' rm_temp 'sums' rm_temp 'roms' + return 1 fi # Verify checksum. @@ -219,6 +224,7 @@ dist_libreboot_get_rom_current() rm_temp 'sums' rm_temp 'roms' rm_temp 'rom' + return 1 fi rm_temp 'sums' |