Used the INSTALL_VERBOSE rule to check whether install can use

the -v flag. If it can't echo is used to mimic its behavior.
This commit is contained in:
Harry Moffat 2006-08-22 00:34:13 +00:00
parent bed3b3c352
commit 16544ffa05

View file

@ -4,6 +4,8 @@
#
# Install a file checking the time step first
#
# HKM -> openBSD doesn't have a -v option
#
if test $# -ne 2 ; then
echo 'install_ts ERROR: This program requires 2 and only 2 parameters:'
echo ' install_ts source DEST_DIR'
@ -12,6 +14,14 @@ fi
lh=$1
INCDIR=$2
#
VERBOSE=@INSTALL_VERBOSE@
verbose='y'
if test "x$VERBOSE" = "x-v" ; then
verbose=
fi
INSTALL_XV="@INSTALL_abs@ -m 755 $VERBOSE "
INSTALL_V="@INSTALL_abs@ -m 644 $VERBOSE "
#
# If the destination directory doesn't exist yet, create it
#
if test ! -d $INCDIR ; then
@ -24,9 +34,12 @@ if test ! -f "${lh}" ; then
fi
if test ! -f "${th}" ; then
if test -x "${lh}" ; then
@INSTALL_abs@ -m 755 -v "${lh}" "${th}"
$INSTALL_XV "${lh}" "${th}"
else
@INSTALL_abs@ -m 644 -v "${lh}" "${th}"
$INSTALL_V "${lh}" "${th}"
fi
if test x"$verbose" = xy ; then
echo "${lh}" ' -> ' "${th}"
fi
else
# if test "${lh}" -nt "${th}" ; then
@ -34,9 +47,12 @@ else
res=$?
if test "$res" = "0" ; then
if test -x "${lh}" ; then
@INSTALL_abs@ -m 755 -v "${lh}" "${th}"
$INSTALL_XV "${lh}" "${th}"
else
@INSTALL_abs@ -m 644 -v "${lh}" "${th}"
$INSTALL_V "${lh}" "${th}"
fi
if test x"$verbose" = xy ; then
echo "${lh}" ' -> ' "${th}"
fi
fi
fi