From 4d65bbf0dfac37c91214ebfb502481aa1c20c8be Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 17 Jul 2019 09:21:41 -0700 Subject: Fix diff-zip.sh so it works on Darwin. BSD find is slightly different and doesn't have -regextype option. --- tools/diff-zip.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/diff-zip.sh b/tools/diff-zip.sh index fa88035f6..d32027ed6 100755 --- a/tools/diff-zip.sh +++ b/tools/diff-zip.sh @@ -4,6 +4,13 @@ # containers, ignoring insignificant formatting differences # in the XML contents. +UNAME=$(uname) +if [ "$UNAME" = "Darwin" ]; then + FIND="find -E" +else + FIND="find -regextype posix-extended" +fi + f1="$1" f2="$2" test -f "$f1" -a -f "$f2" || { @@ -17,7 +24,7 @@ cd "$WORKDIR" mkdir tidy for x in a b; do cp -r $x tidy/ - find $x -regextype posix-extended -iregex '.*\.(xhtml|xml|rdf|rels)' -exec sh -c 'mkdir -p "$(dirname tidy/$1)" && tidy -q -xml -utf8 -i "$1" > "tidy/$1"' _ {} \; + $FIND $x -iregex '.*\.(xhtml|xml|rdf|rels)' -exec sh -c 'mkdir -p "$(dirname tidy/$1)" && tidy -q -xml -utf8 -i "$1" > "tidy/$1"' _ {} \; done cd tidy mkdir c -- cgit v1.2.3