From bbd9d58f7b544749125860f78838e04e91cfaadf Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 13 Mar 2019 15:54:58 -0400 Subject: opkbuild, ob-*: Exit with error on ob_set_text_domain() failure --- (limited to 'src') diff --git a/src/ob-applypatches.sh b/src/ob-applypatches.sh index 165c426..0ab3308 100644 --- a/src/ob-applypatches.sh +++ b/src/ob-applypatches.sh @@ -55,7 +55,10 @@ apply_patches() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi ob_init_package '..' || return 1 ob_parse_package_metadata -c '.opkbuild.cache' || return 1 diff --git a/src/ob-buildenv.sh b/src/ob-buildenv.sh index 14ae813..685852a 100644 --- a/src/ob-buildenv.sh +++ b/src/ob-buildenv.sh @@ -85,7 +85,10 @@ setup_build_flags() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi ob_init_package '..' || return 1 ob_parse_package_metadata -c '.opkbuild.cache' || return 1 diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh index 0e9aa6f..41db005 100644 --- a/src/ob-buildopk.sh +++ b/src/ob-buildopk.sh @@ -40,7 +40,10 @@ build_opk() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi ob_init_package '..' || return 1 ob_parse_package_metadata -c '.opkbuild.cache' || return 1 diff --git a/src/ob-checkbuilddeps.sh b/src/ob-checkbuilddeps.sh index 7cc1fbd..aea3d9a 100644 --- a/src/ob-checkbuilddeps.sh +++ b/src/ob-checkbuilddeps.sh @@ -83,7 +83,10 @@ check_build_deps() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi ob_init_package '..' || return 1 ob_parse_package_metadata -c '.opkbuild.cache' || return 1 diff --git a/src/ob-genchanges.sh b/src/ob-genchanges.sh index 211993e..42e2633 100644 --- a/src/ob-genchanges.sh +++ b/src/ob-genchanges.sh @@ -87,7 +87,10 @@ write_files_bin() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi ob_init_package '..' || return 1 ob_parse_package_metadata -c '.opkbuild.cache' || return 1 diff --git a/src/ob-gencontrol.sh b/src/ob-gencontrol.sh index 738ac9e..822dda6 100644 --- a/src/ob-gencontrol.sh +++ b/src/ob-gencontrol.sh @@ -166,7 +166,10 @@ gen_md5sums() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi ob_init_package '..' || return 1 ob_parse_package_metadata -c '.opkbuild.cache' || return 1 diff --git a/src/ob-installdocs.sh b/src/ob-installdocs.sh index f48134d..06707ee 100644 --- a/src/ob-installdocs.sh +++ b/src/ob-installdocs.sh @@ -58,7 +58,10 @@ install_docs() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi ob_init_package '..' || return 1 ob_parse_package_metadata -c '.opkbuild.cache' || return 1 diff --git a/src/ob-installplatconf.sh b/src/ob-installplatconf.sh index 80b9831..d81628a 100644 --- a/src/ob-installplatconf.sh +++ b/src/ob-installplatconf.sh @@ -69,7 +69,10 @@ copy_config() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi ob_init_package '..' || return 1 ob_parse_package_metadata -c '.opkbuild.cache' || return 1 diff --git a/src/ob-unpacksource.sh b/src/ob-unpacksource.sh index 1202ce0..4a95aec 100644 --- a/src/ob-unpacksource.sh +++ b/src/ob-unpacksource.sh @@ -132,7 +132,10 @@ unpack_upstream() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi ob_init_package '..' || return 1 ob_parse_package_metadata -c '.opkbuild.cache' || return 1 diff --git a/src/opkbuild.sh b/src/opkbuild.sh index d76c568..b7bc160 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -374,7 +374,10 @@ clean() main() { - ob_set_text_domain 'opkbuild' + if ! ob_set_text_domain 'opkbuild'; then + printf '%s: Error: Failed to load locale messages\n' >&2 + return 1 + fi get_options "${@}" || return 1 shift $(($OPTIND - 1)) -- cgit v0.9.1