diff options
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/build.sh | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/src/cmd/build.sh b/src/cmd/build.sh index feced70..021c4aa 100644 --- a/src/cmd/build.sh +++ b/src/cmd/build.sh @@ -68,6 +68,37 @@ _cmd_build_fini() done } +_cmd_build_build() +{ + local host_arch="${1}" + local host_plat="${2}" + shift 2 + local es= + + es=0 + + _cmd_build_build_deps="$(package_get_build_deps \ + "${host_arch}" "${host_plat}")" + if [ "x${_cmd_build_build_deps}" != 'x' ]; then + _cmd_build_make_deps_pkg + if session_exec opkg -a "${host_arch}" print-architecture \ + 1>/dev/null 2>&1; then + session_exec opkg -a "${host_arch}" \ + install ../builddeps.opk || es=${?} + else + session_exec opkg install ../builddeps.opk || es=${?} + fi + fi + + if [ ${es} -eq 0 ]; then + session_exec opkbuild "${@}" || es=${?} + fi + + _cmd_build_fini + + return ${es} +} + cmd_build_main() { local root= @@ -146,25 +177,7 @@ cmd_build_main() fi es=0 - - _cmd_build_build_deps="$(package_get_build_deps \ - "${host_arch}" "${host_plat}")" - if [ "x${_cmd_build_build_deps}" != 'x' ]; then - _cmd_build_make_deps_pkg - if session_exec opkg -a "${host_arch}" print-architecture \ - 1>/dev/null 2>&1; then - session_exec opkg -a "${host_arch}" \ - install ../builddeps.opk || es=${?} - else - session_exec opkg install ../builddeps.opk || es=${?} - fi - fi - - if [ ${es} -eq 0 ]; then - session_exec opkbuild "${@}" || es=${?} - fi - - _cmd_build_fini + _cmd_build_build "${host_arch}" "${host_plat}" "${@}" || es=${?} session_end |