diff --git a/scripts/unpack b/scripts/unpack index 83df55c0ef..ea95857afd 100755 --- a/scripts/unpack +++ b/scripts/unpack @@ -53,13 +53,9 @@ if [ -d "$SOURCES/$1" -o -d "$PKG_DIR/sources" ]; then . $PKG_DIR/package.mk - if [ "$(type -t pre_unpack)" = "function" ]; then - pre_unpack - fi + pkg_call_optional pre_unpack - if [ "$(type -t unpack)" = "function" ]; then - unpack - else + if ! pkg_call unpack; then if [ -n "$PKG_URL" ]; then $SCRIPTS/extract $1 $BUILD fi @@ -82,14 +78,10 @@ if [ -d "$SOURCES/$1" -o -d "$PKG_DIR/sources" ]; then mkdir -p "${PKG_BUILD}" fi - if [ "$(type -t post_unpack)" = "function" ]; then - post_unpack - fi + pkg_call_optional post_unpack if [ "${PKG_SKIP_PATCHES}" != "yes" ]; then - if [ "$(type -t pre_patch)" = "function" ]; then - pre_patch - fi + pkg_call_optional pre_patch if [ "$TARGET_ARCH" = "x86_64" ]; then PATCH_ARCH="x86" @@ -158,9 +150,7 @@ if [ -d "$SOURCES/$1" -o -d "$PKG_DIR/sources" ]; then fi done - if [ "$(type -t post_patch)" = "function" ]; then - post_patch - fi + pkg_call_optional post_patch fi if [ ! "$PKG_NAME" = "configtools" ] ; then