From e93df698ad3c5172cf1157a8c72978b427fc0aa8 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 31 Jul 2012 21:23:56 -0400 Subject: Write oh-unpacksource. --- (limited to 'src/opkbuild.sh') diff --git a/src/opkbuild.sh b/src/opkbuild.sh index 54a22f3..94bc6c7 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -343,58 +343,7 @@ step_unpack() { oh_cv_set step unpack - # TODO: Put this in oh-unpacksource. - if [ -d ../src ]; then - oh_info "${oh_str_unpacking_native}" - cp -Rp ../src src || oh_error "${oh_str_cant_unpack_native}" - else - archive_base_name="${OH_SOURCE}-${OH_SOURCE_VERSION_UPSTREAM}.orig.tar." - archive_matches=$(find .. -name "${archive_base_name}*") - case "$(echo "${archive_matches}" | wc -l)" in - 0) - oh_error "${oh_str_no_sources}" - ;; - 1) - ;; - *) - oh_error "${oh_str_multiple_upstream_sources}" - ;; - esac - z_ext="${archive_matches#../${archive_base_name}}" - case ${z_ext} in - gz) - z=z - ;; - bz2) - z=j - ;; - lz) - z=a - ;; - Z) - z=Z - ;; - *) - oh_error "${oh_str_unsupported_archive_compression}" "${z_ext}" - ;; - esac - sed 's@^./@@' | grep '^[^/]*/$' - top_dirs=$(tar "-t${z}f" "${archive_matches}${z_ext}" | \ - sed -n 's@^\./\([^/]*\)$@\1@p') - case "$(echo "${top_dirs}" | wc -l)" in - 0) - oh_error "${oh_str_no_upstream_dirs}" - ;; - 1) - ;; - *) - oh_error "${oh_str_multiple_top_upstream_dirs}" - esac - oh_info "${oh_str_unpacking_upstream}" - tar "-x${z}f" "${archive_matches}${z_ext}" || \ - oh_error "${oh_str_cant_unpack_upstream}" - mv "${top_dirs}" src || oh_error "${oh_str_cant_move_native}" - fi + oh-unpacksource step_patch } -- cgit v0.9.1