OSDN Git Service

Camera: Fix metadata generation on OS X.
authorEino-Ville Talvala <etalvala@google.com>
Mon, 18 Mar 2013 16:43:57 +0000 (09:43 -0700)
committerIgor Murashkin <iam@google.com>
Mon, 18 Mar 2013 18:53:38 +0000 (11:53 -0700)
- readlink has no -f option.
- mktemp requires a template

Change-Id: I77e2fd6a664cda5edeeeb4d781ab5439d6c7c507

camera/docs/metadata-generate
camera/docs/metadata-parser-sanity-check
camera/docs/metadata-validate

index 7869763..8e5bf56 100755 (executable)
@@ -23,7 +23,7 @@
 #   ../src/camera_metadata_tags.h
 #
 
-thisdir=$(dirname $(readlink -f $0))
+thisdir=$(cd "$(dirname "$0")"; pwd)
 
 function relpath() {
     python -c "import os.path; print os.path.relpath('$1', '$PWD')"
index 520a5f2..76afc48 100755 (executable)
 # as the original parsed data.
 #
 
-thisdir=$(dirname $(readlink -f $0))
+thisdir=$(cd "$(dirname "$0")"; pwd)
 
 $thisdir/metadata-check-dependencies || exit 1
 
-tmp_out=$(mktemp)
-tmp_tidy1=$(mktemp)
-tmp_tidy2=$(mktemp)
+tmp_out=$(mktemp -t tmp.XXXXXXXXXX)
+tmp_tidy1=$(mktemp -t tmp.XXXXXXXXXX)
+tmp_tidy2=$(mktemp -t tmp.XXXXXXXXXX)
 
 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
index 20ad9e6..d507d8e 100755 (executable)
 # limitations under the License.
 #
 
-thisdir=$(dirname $(readlink -f $0))
+thisdir=$(cd "$(dirname "$0")"; pwd)
 $thisdir/metadata-check-dependencies || exit 1
 
 if [[ $# -lt 1 ]]
 then
-    echo "Usage: $(basename $(readlink -f $0)) <properties-file-name.xml>" 1>&2
+    echo "Usage: ${BASH_SOURCE##*/} <properties-file-name.xml>" 1>&2
     exit
 fi