kpatch-build: further shell code cleanup

Replace find * with find ./* to prevent treating files with dashes as
options. The leading ./ is later used in comparisons and thus must be
removed before that.

Found by shellcheck.
This commit is contained in:
Simon Ruderich 2017-10-13 11:45:06 +02:00
parent 73cf473a21
commit 223c65015c
1 changed files with 2 additions and 2 deletions

View File

@ -290,8 +290,8 @@ find_parent_obj() {
num="$(grep -l "$grepname" "$last_deep_find"/.*.cmd | grep -vc "$pdir/.${file}.cmd")"
fi
if [[ "$num" -eq 0 ]]; then
parent="$(find * -name ".*.cmd" -print0 | xargs -0 grep -l "$grepname" | grep -v "$pdir/.${file}.cmd" |head -n1)"
num="$(find * -name ".*.cmd" -print0 | xargs -0 grep -l "$grepname" | grep -vc "$pdir/.${file}.cmd")"
parent="$(find ./* -name ".*.cmd" -print0 | xargs -0 grep -l "$grepname" | grep -v "$pdir/.${file}.cmd" | cut -c3- | head -n1)"
num="$(find ./* -name ".*.cmd" -print0 | xargs -0 grep -l "$grepname" | grep -vc "$pdir/.${file}.cmd")"
[[ "$num" -eq 1 ]] && last_deep_find="$(dirname "$parent")"
fi
else