Camera2: Update generate scripts check for dependencies and to support MacPorts
Change-Id: Ice9b658f8e6f87a1a490c367bff2f9a685ddee44
diff --git a/camera/docs/metadata-parser-sanity-check b/camera/docs/metadata-parser-sanity-check
index 940300c..a7ff41e 100755
--- a/camera/docs/metadata-parser-sanity-check
+++ b/camera/docs/metadata-parser-sanity-check
@@ -21,20 +21,15 @@
# as the original parsed data.
#
-tidy=$(which tidy)
-if [[ $? -ne 0 ]]
-then
- echo "Missing tidy binary, please install with 'sudo apt-get install tidy'" 1>&2
- exit 1
-fi
-
thisdir=$(dirname $(readlink -f $0))
+$thisdir/metadata-check-dependencies || exit 1
+
tmp_out=$(mktemp)
tmp_tidy1=$(mktemp)
tmp_tidy2=$(mktemp)
-$thisdir/metadata_parser_xml.py $thisdir/metadata_properties.xml $thisdir/metadata_template.mako > $tmp_out || exit 1
+python $thisdir/metadata_parser_xml.py $thisdir/metadata_properties.xml $thisdir/metadata_template.mako > $tmp_out || exit 1
tidy -indent -xml -quiet $thisdir/metadata_properties.xml > $tmp_tidy1
tidy -indent -xml -quiet $tmp_out > $tmp_tidy2