On Fri, Apr 24, 2009 at 3:05 PM, Gabor Gombas <gomb...@sztaki.hu> wrote:

> Hmm, wouldn't it be better to look for the newest version instead of
> "first one that's newer"? The above would work on a buildd where there is
> nothing in $HOME or under /usr/local, but could break on user's machines
> if they have a script in say /usr/local/share/automake that's newer than
> what the package has, but still older than what would be needed to build
> correctly.

Good point, how about this?

cur_v=`echo "$timestamp" | sed s/-//g`

for path in \
  "$HOME/.config/automake" \
  /usr/local/share/automake \
  /usr/share/automake \
  /usr/share/misc \
    ; do

    if test -x "$path/config.guess" ; then
      v=`"$path/config.guess" --time-stamp | sed s/-//g`
      if test "$v" -gt "$cur_v" ; then
        cur_v="$v"
        latest="$path"
      fi
    fi
done

if test "x$latest" != x ; then
  case $# in
    0) "$latest/config.guess";;
    *) "$latest/config.guess" "$@";;
  esac
  exit $?
fi

-- 
bye,
pabs

http://wiki.debian.org/PaulWise


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to