diff options
Diffstat (limited to 'src/ob-unpacksource.sh')
-rw-r--r-- | src/ob-unpacksource.sh | 50 |
1 files changed, 25 insertions, 25 deletions
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 "${@}" |