#! /bin/sh

# Copyright (C) 1999, Free Software Foundation
# Originally by Alexandre Oliva <oliva@gnu.org>

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html

# ``Touch'' soft-links so that their timestamps appear newer to cvs.
# Soft-links are re-created, since the timestamp of a soft-link can't
# usually be changed.

# The argument list may contain files, soft-links and directories.
# Files that are not soft-links are ignored.  Directories are searched
# recursively for soft-links.  If no argument is specified, the
# current directory is assumed.

test $# = 0 && set .

find ${1+"$@"} -type l -print |
while read f; do
  test -h $f || continue # just in case
  link=`ls -l $f | sed 's/.* -> //'`
  rm -f $f
  ln -s $link $f
done
