From 14066b010aa107c90b673f9ccb4af68d0cd9d79f Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sun, 5 Jan 2014 20:14:45 +0200 Subject: [PATCH] scripts/unpack: add {pre,post}_patch. post_unpack before patching --- scripts/unpack | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/unpack b/scripts/unpack index ce09c46e07..ae808f51c1 100755 --- a/scripts/unpack +++ b/scripts/unpack @@ -79,6 +79,8 @@ if [ -f $PKG_DIR/package.mk ]; then unset -f pre_unpack unset -f unpack unset -f post_unpack + unset -f pre_patch + unset -f post_patch . $PKG_DIR/package.mk @@ -109,6 +111,9 @@ if [ -f $PKG_DIR/package.mk ]; then [ ! -d "$BUILD/${PKG_NAME}-${PKG_VERSION}" ] && mkdir -p $BUILD/${PKG_NAME}-${PKG_VERSION} cp -PRf $PKG_DIR/sources/* $BUILD/${PKG_NAME}-${PKG_VERSION} fi + if [ "$(type -t post_unpack)" = "function" ]; then + post_unpack + fi else if [ -n "$PKG_URL" ]; then $SCRIPTS/extract $1 "$1*.tar.bz2" $BUILD @@ -135,6 +140,12 @@ else fi fi +if [ -f $PKG_DIR/package.mk ]; then + if [ "$(type -t pre_patch)" = "function" ]; then + pre_patch + fi +fi + for i in $PKG_DIR/patches/$PKG_NAME-*.patch ; do if [ -f "$i" ]; then PATCH=`basename $i` @@ -177,13 +188,9 @@ 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 - if [ "$(type -t post_unpack)" = "function" ]; then - post_unpack + if [ "$(type -t post_patch)" = "function" ]; then + post_patch fi fi