From f3577c43a4bb72b77795a41196eb3d7a1e603ad9 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 25 Dec 2018 18:00:18 -0500 Subject: opkbuild: Define main() after the functions it calls --- diff --git a/src/opkbuild.sh b/src/opkbuild.sh index cefcc78..de69d5d 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -46,42 +46,6 @@ opt_check_build_deps= opt_clean= opt_uid0_cmd= -main() -{ - ob_set_text_domain 'opkbuild' - - get_options "${@}" - shift $(($OPTIND - 1)) - if [ ${#} -ne 0 ]; then - usage - exit 1 - fi - - test_uid0_cmd - - setup_arch_plat - - make_work_area - - setup_package - - if [ "${opt_build}" = 'source' -o "${opt_build}" = 'full' ]; then - build_source - fi - - if [ "${opt_build}" != 'source' ]; then - print_arch_stats - if "${opt_check_build_deps}"; then - if ! "${BINDIR}/ob-checkbuilddeps"; then - exit 1 - fi - fi - setup_build - build - clean - fi -} - usage() { printf "$(ob_get_msg 'usage')\n" 'opkbuild' @@ -381,4 +345,40 @@ clean() fi } +main() +{ + ob_set_text_domain 'opkbuild' + + get_options "${@}" + shift $(($OPTIND - 1)) + if [ ${#} -ne 0 ]; then + usage + exit 1 + fi + + test_uid0_cmd + + setup_arch_plat + + make_work_area + + setup_package + + if [ "${opt_build}" = 'source' -o "${opt_build}" = 'full' ]; then + build_source + fi + + if [ "${opt_build}" != 'source' ]; then + print_arch_stats + if "${opt_check_build_deps}"; then + if ! "${BINDIR}/ob-checkbuilddeps"; then + exit 1 + fi + fi + setup_build + build + clean + fi +} + main "${@}" -- cgit v0.9.1