MT#4295 Be more strict with option handling when passing file names to grep

0.18
Michael Prokop 13 years ago
parent cc0a0e5847
commit f2e9a5e8e6

@ -135,7 +135,7 @@ generate_template_list() {
else
# arguments (file list/pattern) provided via cmdline
for arg in $* ; do
if echo $file | grep -q "${arg}" ; then
if echo $file | grep -q -- "${arg}" ; then
echo "$file" >> "${filelist_prepared}"
fi
done
@ -157,21 +157,21 @@ generate_template_list() {
# foo.customtt.tt2.sp{1,2}
if [ -n "${HA_FILE:-}" ] ; then
if grep -q "^${normalized_filename}.customtt.tt2${HA_FILE:-}" "${filelist_prepared}" ; then
if grep -q -- "^${normalized_filename}.customtt.tt2${HA_FILE:-}" "${filelist_prepared}" ; then
echo "${normalized_filename}.customtt.tt2${HA_FILE:-}" >> "${filelist_final}"
continue
fi
fi
# foo.customtt.tt2
if grep -q "^${normalized_filename}.customtt.tt2$" "${filelist_prepared}" ; then
if grep -q -- "^${normalized_filename}.customtt.tt2$" "${filelist_prepared}" ; then
echo "${normalized_filename}.customtt.tt2" >> "${filelist_final}"
continue
fi
# foo.tt2.sp{1,2}
if [ -n "${HA_FILE:-}" ] ; then
if grep -q "^${normalized_filename}.tt2${HA_FILE}" "${filelist_prepared}" ; then
if grep -q -- "^${normalized_filename}.tt2${HA_FILE}" "${filelist_prepared}" ; then
echo "${normalized_filename}.tt2${HA_FILE}" >> "${filelist_final}"
continue
fi

@ -77,7 +77,7 @@ else
if [ -n "${EXTRA_CONFIG_FILES:-}" ] ; then
for file in $EXTRA_CONFIG_FILES ; do
if git diff-index --name-only HEAD | grep -qe "$(basename $file)" ; then
if git diff-index --name-only HEAD | grep -qe -- "$(basename $file)" ; then
log_debug "modification in EXTRA_CONFIG_FILES file $file found"
trigger_rebuild=true
break # no reason for further checks

Loading…
Cancel
Save