Skip to content

Commit

Permalink
Mk/Scripts/smart_makepatch.sh: Force diff to produce the patch file i…
Browse files Browse the repository at this point in the history
…nstead 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)
  • Loading branch information
sunpoet committed Jul 14, 2021
1 parent edc51a7 commit fcb34fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Mk/Scripts/smart_makepatch.sh
Expand Up @@ -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
Expand Down

0 comments on commit fcb34fa

Please sign in to comment.