More unit fixes.

This commit is contained in:
Roy Marples 2008-07-03 12:33:42 +00:00
parent e0968a1c2e
commit aa57dd1ff6

View File

@ -11,30 +11,29 @@ TMPDIR=tmp-"$(basename "$0")"
# the reference file # the reference file
# #
# EXAMPLE: if is_older_than a.out *.o ; then ... # EXAMPLE: if is_older_than a.out *.o ; then ...
is_older_than() { ref_is_older_than() {
local x= ref="$1" local x= ref="$1"
shift shift
for x; do for x; do
[ "${x}" -nt "${ref}" ] && return 0 [ "${x}" -nt "${ref}" ] && return 0
[ -d "${x}" ] && is_older_than "${ref}" "${x}"/* && return 0 [ -d "${x}" ] && ref_is_older_than "${ref}" "${x}"/* && return 0
done done
return 1 return 1
} }
rm -rf "${TMPDIR}" rm -rf "${TMPDIR}"
mkdir "${TMPDIR}" mkdir "${TMPDIR}"
ln -s ../"${RCDIR}"/rc "${TMPDIR}"/is_older_than
do_test() { do_test() {
local r1= r2= local r1= r2=
is_older_than "$@" ref_is_older_than "$@"
r1=$? r1=$?
./"${TMPDIR}"/is_older_than "$@" is_older_than "$@"
r2=$? r2=$?
[ -n "${VERBOSE}" ] && echo "baselayout = $r1 | OpenRC = $r2" [ -n "${VERBOSE}" ] && echo "reference = $r1 | OpenRC = $r2"
[ $r1 = $r2 ] [ $r1 = $r2 ]
} }