Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jul 2021 16:20:09 GMT
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: fcb34faf7067 - main - Mk/Scripts/smart_makepatch.sh: Force diff to produce the patch file instead of "Binary files ... differ" message
Message-ID:  <202107141620.16EGK9rm016159@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fcb34faf706733a667358b293970fac444251828

commit fcb34faf706733a667358b293970fac444251828
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2021-07-14 16:06:05 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2021-07-14 16:15:03 +0000

    Mk/Scripts/smart_makepatch.sh: Force diff to produce the patch file instead of "Binary files ... differ" message
    
    It helps avoid generating wrong patches, e.g. patch-grpc.gemspec in r567838 [1].
    
    from diff manpage:
        -a --text
            Treat all files as ASCII text.  Normally diff will simply print
            "Binary files ... differ" if files contain binary characters.
            Use of this option forces diff to produce a diff.
    
    [1] https://cgit.FreeBSD.org/ports/diff/net/rubygem-grpc130/files/patch-grpc.gemspec?id=073c1c710a0c7254820adab9920c1903ace83fae
    
    PR:             257027
    Approved by:    mat (portmgr)
---
 Mk/Scripts/smart_makepatch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Mk/Scripts/smart_makepatch.sh b/Mk/Scripts/smart_makepatch.sh
index 5146d01a84cd..96ad7e6ee78c 100644
--- a/Mk/Scripts/smart_makepatch.sh
+++ b/Mk/Scripts/smart_makepatch.sh
@@ -193,7 +193,7 @@ regenerate_patches() {
 		NEW=${ORIG%.orig}
 		cmp -s ${ORIG} ${NEW} && continue
 		OUT=${REGENNED}/$(std_patch_filename ${NEW})
-		TZ=UTC diff -udp ${ORIG} ${NEW} | sed \
+		TZ=UTC diff -audp ${ORIG} ${NEW} | sed \
 			-e '/^---/s|\.[0-9]* +0000$| UTC|' \
 			-e '/^+++/s|\([[:blank:]][-0-9:.+]*\)*$||' \
 			> ${OUT} || true



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107141620.16EGK9rm016159>