]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Add support for patches with level 0.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 12 Dec 2010 21:20:36 +0000 (22:20 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 12 Dec 2010 21:20:36 +0000 (22:20 +0100)
They must end with ".patch0".

pkgs/Constants
tools/patch

index 92d64775652901ecfae1fd4753709e458328e4f5..3dc72399b11335612f618fd3c0cba4b0aefc5cf0 100644 (file)
@@ -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))
index 93be79a0a8109f98ac02ac0189f54fd960e6d786..68fef901aff236f147a7681d887cc4b3efc1ac43 100755 (executable)
@@ -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