]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: make libtool patching more robust
authorKarel Zak <kzak@redhat.com>
Tue, 19 Oct 2021 08:52:10 +0000 (10:52 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 19 Oct 2021 08:52:10 +0000 (10:52 +0200)
Fixes: https://github.com/karelzak/util-linux/issues/1476
Signed-off-by: Karel Zak <kzak@redhat.com>
autogen.sh

index 9b6cfd390ba39ce5c056137264e06c1232ac73ad..14f8e23ba2df9de4713363f2faa4dfc3c8ca4b7b 100755 (executable)
@@ -134,7 +134,10 @@ if test -f tools/libtool.m4.patch; then
                rm m4/libtool.m4
                mv m4/libtool.m4.org m4/libtool.m4
        fi
-       patch -p1 --batch < tools/libtool.m4.patch
+       patch --batch --dry -p1 < tools/libtool.m4.patch &> /dev/null;
+       if [ "$?" -eq 0 ]; then
+               patch -p1 --batch < tools/libtool.m4.patch
+       fi
 fi
 
 aclocal -I m4 $AL_OPTS