Fix generating debug/trace tags.
authorMathias Preiner <mathias.preiner@gmail.com>
Mon, 24 Sep 2018 15:57:29 +0000 (08:57 -0700)
committerMathias Preiner <mathias.preiner@gmail.com>
Mon, 24 Sep 2018 15:57:29 +0000 (08:57 -0700)
src/base/genheader.sh
src/base/gentags.sh
src/base/gentmptags.sh

index a4bff7306d5cef77d299603656ee1b72d3ba7840..2091f7781dc325a635a01052aba821b250f6863a 100755 (executable)
@@ -11,11 +11,11 @@ shift
 tags_type="$1" # Debug/Trace
 tags_file="${tags_type}_tags"
 
-if [ "${tags_type}" != "Debug" -a "${tags_type}" != "Trace" ]; then
+if [ "${tags_type}" != "Debug" ] && [ "${tags_type}" != "Trace" ]; then
   echo "$0: Invalid tags type '${tags_type}' (must be 'Debug' or 'Trace')"
   exit 1
 fi
 
 [ ! -e "${tags_file}" ] && echo "$0: ${tags_file} does not exist" && exit 1
 
-${path}/mktagheaders ${tags_file} ${tags_file} > ${tags_file}.h
+"${path}/mktagheaders" "${tags_file}" "${tags_file}" > "${tags_file}.h"
index 8c180e4108124ae1ea60b695d980335556fb6fdb..67888b3f516b9eade7e476d7e99641cf96e9e752 100755 (executable)
@@ -11,7 +11,7 @@
 tags_type="$1" # Debug/Trace
 tags_file="${tags_type}_tags"
 
-if [ "${tags_type}" != "Debug" -a "${tags_type}" != "Trace" ]; then
+if [ "${tags_type}" != "Debug" ] && [ "${tags_type}" != "Trace" ]; then
   echo "$0: Invalid tags type '${tags_type}' (must be 'Debug' or 'Trace')"
   exit 1
 fi
@@ -21,6 +21,6 @@ fi
 
 if [ -e "${tags_file}" ]; then
   # Do not update file if tags didn't change.
-  diff -q ${tags_file}.tmp ${tags_file} &> /dev/null && exit 0
+  diff -q "${tags_file}.tmp" "${tags_file}" > /dev/null 2>&1 && exit 0
 fi
-mv ${tags_file}.tmp ${tags_file}
+mv "${tags_file}.tmp" "${tags_file}"
index 31404a16a7f414faaa09665105d934ccd6b550df..566fa17479b8181651707f6b6483f79d7e64e5ae 100755 (executable)
@@ -11,11 +11,11 @@ shift
 tags_type="$1"
 tags_file="${tags_type}_tags"
 shift
-source_files_list="$@"
+source_files_list="$*"
 
-if [ "${tags_type}" != "Debug" -a "${tags_type}" != "Trace" ]; then
+if [ "${tags_type}" != "Debug" ] && [ "${tags_type}" != "Trace" ]; then
   echo "$0: Invalid tags type '${tags_type}' (must be 'Debug' or 'Trace')"
   exit 1
 fi
 
-${path}/mktags ${tags_type} ${source_files_list} > ${tags_file}.tmp
+"${path}/mktags" "${tags_type}" "${source_files_list}" > "${tags_file}.tmp"