diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2018-12-25 18:00:18 (EST) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2018-12-25 18:00:18 (EST) |
commit | f3577c43a4bb72b77795a41196eb3d7a1e603ad9 (patch) | |
tree | ec3e6626a2fd7b463f3569937424994b2232e2b1 | |
parent | 888b97fbda8aa867816770fb495dad105411a3eb (diff) |
opkbuild: Define main() after the functions it calls
-rw-r--r-- | src/opkbuild.sh | 72 |
1 files changed, 36 insertions, 36 deletions
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 "${@}" |