Revert "buildsystem: rework patching. prepare to remove patches.upstream/"

This reverts (part of) commit f920a33507852a9af865a399c877073bf52d3f8b.

patch --dry-run fails with patches generated with git format-patch --stdout..

closes #2856
This commit is contained in:
Stefan Saraev 2014-01-02 16:24:09 +02:00
parent b8815448fb
commit e784a2114f
2 changed files with 3 additions and 10 deletions

View File

@ -55,13 +55,6 @@ setup_toolchain() {
fi
}
apply_patch() {
patch -d "$2" -p0 -f --dry-run < $1 &> /dev/null && patch -d "$2" -p0 < $1 && return 0
patch -d "$2" -p1 -f --dry-run < $1 &> /dev/null && patch -d "$2" -p1 < $1 && return 0
echo "*** Failed to apply '$1'! ***"
return 1
}
kernel_path() {
if [ -f $ROOT/packages/linux/package.mk ] ; then
. $ROOT/packages/linux/package.mk

View File

@ -144,7 +144,7 @@ for i in $PKG_DIR/patches/$PKG_NAME-*.patch ; do
continue;
else
printf "%${BUILD_INDENT}c ${boldgreen}APPLY PATCH${endcolor} ${boldwhite}(common)${endcolor} $i\n" ' '>&$SILENT_OUT
apply_patch $i $PKG_BUILD || exit 1
cat $i | patch -d `echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT
fi
fi
done
@ -158,7 +158,7 @@ for i in $PKG_DIR/patches/$PKG_VERSION/*.patch ; do
continue;
else
printf "%${BUILD_INDENT}c ${boldgreen}APPLY PATCH${endcolor} ${boldwhite}($PKG_VERSION)${endcolor} $i\n" ' '>&$SILENT_OUT
apply_patch $i $PKG_BUILD || exit 1
cat $i | patch -d `echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT
fi
fi
done
@ -172,7 +172,7 @@ for i in $PROJECT_DIR/$PROJECT/patches/$PKG_NAME/*.patch ; do
continue;
else
printf "%${BUILD_INDENT}c ${boldgreen}APPLY PATCH${endcolor} ${boldwhite}(project)${endcolor} $i\n" ' '>&$SILENT_OUT
apply_patch $i $PKG_BUILD || exit 1
cat $i | patch -d `echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT
fi
fi
done