mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-21 15:13:10 +01:00
Merge branch 'busybox-shell-fixes/v1' into 'master'
lib.cli-std: fix two shell errors when AUTOMAKE is false See merge request shorewall/code!14
This commit is contained in:
commit
2673e6e60c
@ -381,36 +381,33 @@ uptodate() {
|
||||
[ -x $1 ] || return 1
|
||||
|
||||
local dir
|
||||
local busybox
|
||||
local find
|
||||
local quit
|
||||
local maxdepth
|
||||
|
||||
find=$(mywhich find)
|
||||
|
||||
[ -n "${find}" ] || return 1
|
||||
[ -h "${find}" ] && busybox=Yes
|
||||
find="${find} -L"
|
||||
|
||||
if [ -h "${find}" ]; then
|
||||
#
|
||||
# 'Find' is provided by Busybox and doesn't support -quit.
|
||||
#
|
||||
quit=
|
||||
else
|
||||
quit=-quit
|
||||
fi
|
||||
|
||||
if [ "$AUTOMAKE" = recursive ]; then
|
||||
maxdepth=
|
||||
elif [ -z "$AUTOMAKE" ]; then
|
||||
maxdepth="-maxdepth 1"
|
||||
else
|
||||
maxdepth="-maxdepth $AUTOMAKE"
|
||||
fi
|
||||
|
||||
for dir in $g_shorewalldir $(split $CONFIG_PATH); do
|
||||
if [ -n "${busybox}" ]; then
|
||||
#
|
||||
# Busybox 'find' doesn't support -quit.
|
||||
#
|
||||
if [ $AUTOMAKE = recursive ]; then
|
||||
if [ -n "$(${find} ${dir} -newer $1 -print)" ]; then
|
||||
return 1;
|
||||
fi
|
||||
elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print)" ]; then
|
||||
return 1;
|
||||
fi
|
||||
elif [ "$AUTOMAKE" = recursive ]; then
|
||||
if [ -n "$(${find} ${dir} -newer $1 -print -quit)" ]; then
|
||||
return 1;
|
||||
fi
|
||||
elif [ -z "$AUTOMAKE" ]; then
|
||||
if [ -n "$(${find} ${dir} -maxdepth 1 -type f -newer $1 -print -quit)" ]; then
|
||||
return 1;
|
||||
fi
|
||||
elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print -quit)" ]; then
|
||||
if [ -n "$(${find} -L ${dir} ${maxdepth} -newer $1 -print ${quit})" ]; then
|
||||
return 1;
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user