Allow AUTOMAKE=<depth> to specify search depth

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep
2018-03-03 10:09:10 -08:00
parent 9e002a7689
commit 02ed6f26a9
3 changed files with 27 additions and 4 deletions

View File

@ -281,10 +281,15 @@ get_config() {
case $AUTOMAKE in
Yes|yes)
AUTOMAKE=1
;;
No|no)
AUTOMAKE=
;;
[1-9])
;;
[1-9][0-9])
;;
*)
if [ -n "$AUTOMAKE" ]; then
fatal_error "Invalid AUTOMAKE setting ($AUTOMAKE)"
@ -397,10 +402,10 @@ uptodate() {
#
# Busybox 'find' doesn't support -quit.
#
if [ -n "$(${find} ${dir} -maxdepth 1 -type f -newer $1 -print)" ]; then
if [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print)" ]; then
return 1;
fi
elif [ -n "$(${find} ${dir} -maxdepth 1 -type f -newer $1 -print -quit)" ]; then
elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print -quit)" ]; then
return 1;
fi
done