Try to detect seq versions installed by earlier fish versions and replace them

darcs-hash:20061103131621-ac50b-2748c958f8614f39fbaa7a45261877a912de539e.gz
This commit is contained in:
axel 2006-11-03 23:16:21 +10:00
parent 49e300d0ca
commit 8aac7e82c0

View file

@ -147,6 +147,29 @@ AC_PROG_INSTALL
AC_CHECK_PROG( SEQ_FALLBACK, seq, [ ], [seq])
if test "$SEQ_FALLBACK"; then
#
# We already have seq. Check if the seq version is installed by an
# earlier fish version. If it is, we'll replace it.
#
file=`which seq`
if test -f "$file"; then
AC_MSG_CHECKING([if seq comes from a previous fish version])
shebang=`grep "\(^#!/.*/fish\|^#!/usr/bin/env fish\)" $file`
if test "$shebang"; then
AC_SUBST( SEQ_FALLBACK, seq )
AC_MSG_RESULT(yes, replace it)
else
AC_MSG_RESULT(no, keep it)
fi
fi
fi
#
# Optionally drop xsel command
#