From 888b97fbda8aa867816770fb495dad105411a3eb Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 25 Dec 2018 16:11:38 -0500 Subject: ob-*: Move function definitions before points of use --- (limited to 'src/ob-unpacksource.sh') diff --git a/src/ob-unpacksource.sh b/src/ob-unpacksource.sh index 478fa17..26bb537 100644 --- a/src/ob-unpacksource.sh +++ b/src/ob-unpacksource.sh @@ -24,37 +24,12 @@ upstream_ar= upstream_ar_z= upstream_ar_dir= -main() -{ - ob_set_text_domain 'opkbuild' - - ob_init_package '..' || exit 1 - ob_parse_package_metadata -c '.opkbuild.cache' || exit 1 - - if [ -d 'src' ]; then - ob_info "$(ob_get_msg 'already_unpacked')" - else - if [ -d '../src' ]; then - unpack_native - elif get_upstream_archive; then - unpack_upstream - fi - fi -} - unpack_native() { ob_info "$(ob_get_msg 'unpacking_native')" cp -Rp '../src' 'src' || ob_error "$(ob_get_msg 'cant_unpack_native')" } -unpack_upstream() -{ - get_upstream_compression - get_upstream_dir - extract_upstream -} - get_upstream_archive() { upstream_ar_base="${OPK_SOURCE}-${OPK_SOURCE_VERSION_UPSTREAM}.orig.tar" @@ -123,4 +98,29 @@ extract_upstream() ob_error "$(ob_get_msg 'cant_move_native')" } +unpack_upstream() +{ + get_upstream_compression + get_upstream_dir + extract_upstream +} + +main() +{ + ob_set_text_domain 'opkbuild' + + ob_init_package '..' || exit 1 + ob_parse_package_metadata -c '.opkbuild.cache' || exit 1 + + if [ -d 'src' ]; then + ob_info "$(ob_get_msg 'already_unpacked')" + else + if [ -d '../src' ]; then + unpack_native + elif get_upstream_archive; then + unpack_upstream + fi + fi +} + main "${@}" -- cgit v0.9.1