Fix diff-zip.sh so it works on Darwin.
BSD find is slightly different and doesn't have -regextype option.
commit4d65bbf0dfac37c91214ebfb502481aa1c20c8be
authorJohn MacFarlane <jgm@berkeley.edu>
dateWed 17 Jul 2019, 09:21 (7 years ago)
parentc75faac
tools/diff-zip.sh+8−1
@@ -4,6 +4,13 @@
44# containers, ignoring insignificant formatting differences
55# in the XML contents.
66
7+UNAME=$(uname)
8+if [ "$UNAME" = "Darwin" ]; then
9+ FIND="find -E"
10+else
11+ FIND="find -regextype posix-extended"
12+fi
13+
714f1="$1"
815f2="$2"
916test -f "$f1" -a -f "$f2" || {
@@ -17,7 +24,7 @@ cd "$WORKDIR"
1724mkdir tidy
1825for x in a b; do
1926 cp -r $x tidy/
20− 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"' _ {} \;
27+ $FIND $x -iregex '.*\.(xhtml|xml|rdf|rels)' -exec sh -c 'mkdir -p "$(dirname tidy/$1)" && tidy -q -xml -utf8 -i "$1" > "tidy/$1"' _ {} \;
2128done
2229cd tidy
2330mkdir c