From fb8d102bf03f6bb655284b9162664a0718e155f8 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 02 Aug 2012 09:59:18 -0400 Subject: Fix ordering of functions. --- (limited to 'src/opkbuild.sh') diff --git a/src/opkbuild.sh b/src/opkbuild.sh index 7ba330e..8c50e6c 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -81,20 +81,22 @@ main() find_sanity oh_changelog_parse setup_package + setup_source_control + + make_work_area if [ "${OPT_BUILD}" = 'source' -o "${OPT_BUILD}" = 'full' ]; then build_source fi if [ "${OPT_BUILD}" != 'source' ]; then - setup_source_control "${OPT_CHECK_BUILD_DEPS}" && oh-checkbuilddeps setup_build print_arch_stats if [ -n "${OH_CV_STEP}" ]; then "step_${OH_CV_STEP}" else - make_work_area + step_unpack fi fi } @@ -226,12 +228,33 @@ setup_package() { OH_SOURCE="${OH_CHANGELOG_SOURCE}" OH_SOURCE_VERSION="${OH_CHANGELOG_VERSION}" - OH_SOURCE_VERSION_UPSTREAM="${OH_SOURCE_VERSION:%%-}" + OH_SOURCE_VERSION_UPSTREAM="${OH_SOURCE_VERSION%%-*}" OH_BINARY_VERSION="${OH_SOURCE_VERSION}" return 1 } +setup_source_control() +{ + oh_control_parse_source + for field in ${OH_CONTROL_SOURCE_FIELDS_REQUIRED} \ + ${OH_CONTROL_SOURCE_FIELDS_OPTIONAL}; do + param="OH_CONTROL_SOURCE_FIELD_$(echo "${field}" | \ + LC_CTYPE=C tr '[:lower:]-' '[:upper:]_')" + oh_pv_set 'src:.control' "${field}" "$(eval echo \$\{"${param}"\})" + done +} + +make_work_area() +{ + if [ ! -d tmp ]; then + mkdir tmp || oh_error "${oh_str_cant_make_work_area}" + fi + cd tmp || oh_error "${oh_str_cant_enter_work_area}" + + oh_set_source_dir .. +} + build_source() { oh_info "${oh_str_installing_src_pkg_files}" @@ -257,20 +280,10 @@ build_source() oh_control_gen_source # TODO: oh-buildopk + return 0 rm -Rf "src:${OH_SOURCE}.data" || oh_error "${oh_str_cant_rm_src_pkg_data}" } -setup_source_control() -{ - oh_control_parse_source - for field in ${OH_CONTROL_SOURCE_FIELDS_REQUIRED} \ - ${OH_CONTROL_SOURCE_FIELDS_OPTIONAL}; do - param="OH_CONTROL_SOURCE_FIELD_$(echo "${field}" | \ - LC_CTYPE=C tr '[:lower:]-' '[:upper:]_')" - oh_pv_set 'src:.control' "${field}" "$(eval echo \$\{"${param}"\})" - done -} - setup_build() { setup_build_arch @@ -359,16 +372,6 @@ print_arch_stats() oh_info "${oh_str_arch_stat_plat}" "${OH_HOST_PLATFORM}" } -make_work_area() -{ - mkdir tmp || oh_error "${oh_str_cant_make_work_area}" - cd tmp || oh_error "${oh_str_cant_enter_work_area}" - - oh_set_source_dir .. - - step_unpack -} - step_unpack() { oh_cv_set step unpack -- cgit v0.9.1