From: Michael Tremer Date: Sun, 12 Dec 2010 21:20:36 +0000 (+0100) Subject: naoki: Add support for patches with level 0. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b289d8329aa21b11f3dd992eb7d4b26de6717b29;p=ipfire-3.x.git naoki: Add support for patches with level 0. They must end with ".patch0". --- diff --git a/pkgs/Constants b/pkgs/Constants index 92d647756..3dc72399b 100644 --- a/pkgs/Constants +++ b/pkgs/Constants @@ -118,6 +118,8 @@ PKG_PACKAGES_FILES = $(foreach package,$(PKG_PACKAGES),$(call DO_PACKAGE_FILENAM # Automatically detect all patches in "patches" PKG_PATCHES = \ $(foreach patch,$(wildcard $(DIR_PATCHES)/*.patch),$(notdir $(patch))) +PKG_PATCHES += \ + $(foreach patch,$(wildcard $(DIR_PATCHES)/*.patch0),$(notdir $(patch))) # Dynamic command that applies all patches DO_PATCHES = cd $(DIR_APP) && $(DIR_TOOLS)/patch $(foreach patch,$(PKG_PATCHES),$(DIR_PATCHES)/$(patch)) diff --git a/tools/patch b/tools/patch index 93be79a0a..68fef901a 100755 --- a/tools/patch +++ b/tools/patch @@ -3,7 +3,13 @@ for patch in $@; do echo "Applying file ${patch}..." - patch -Np1 -i ${patch} + if [ "${patch##*/*.}" = "patch0" ]; then + cmd="patch -Np0" + else + cmd="patch -Np1" + fi + + ${cmd} -i ${patch} ret=$? if [ ${ret} -ne 0 ]; then