diff --git a/scripts/unpack b/scripts/unpack index a9c1f944b4..95983781f0 100755 --- a/scripts/unpack +++ b/scripts/unpack @@ -90,19 +90,6 @@ if [ -n "$PKG_SOURCE_DIR" ]; then mv $BUILD/$PKG_SOURCE_DIR $BUILD/$PKG_NAME-$PKG_VERSION fi -# post_unpack() : Formerly used to replace $PKG_DIR/rename, now replaced by -# $PKG_SOURCE_DIR . Keep this here for other usage or remove later -if [ -f $PKG_DIR/package.mk ]; then - # unset functions - unset -f post_unpack - - . $PKG_DIR/package.mk - - if [ "$(type -t post_unpack)" = "function" ]; then - post_unpack - fi -fi - if [ -d "$PKG_DIR/sources" ]; then [ ! -d "$BUILD/${PKG_NAME}-${PKG_VERSION}" ] && mkdir -p $BUILD/${PKG_NAME}-${PKG_VERSION} cp -PRf $PKG_DIR/sources/* $BUILD/${PKG_NAME}-${PKG_VERSION} @@ -150,6 +137,22 @@ for i in $PROJECT_DIR/$PROJECT/patches/$PKG_NAME/*.patch ; do fi done +# post_unpack() : +# - Formerly used to replace $PKG_DIR/rename +# - now replaced by $PKG_SOURCE_DIR . +# - now moved after patching to replace the formerly 'unpack' script +if [ -f $PKG_DIR/package.mk ]; then + # unset functions + unset -f post_unpack + + . $PKG_DIR/package.mk + + if [ "$(type -t post_unpack)" = "function" ]; then + post_unpack + fi +fi + +# todo: deprecated [ -f "$PKG_DIR/unpack" ] && $PKG_DIR/unpack $@ >&$VERBOSE_OUT for config in `find $BUILD/$1* -name config.guess | sed 's/config.guess//'`; do