From 111a0b97dada1741561e471846ea7757309b6dc5 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 17 Jul 1998 18:18:00 +0000 Subject: [PATCH] ylwrap fix from HJ Lu --- ChangeLog | 5 +++++ lib/ylwrap | 16 ++++++++++++++++ ylwrap | 16 ++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/ChangeLog b/ChangeLog index 624746690..c85a3f9da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jul 17 07:37:20 1998 H.J. Lu (hjl@gnu.org) + + * ylwrap: Don't use absolute path if the input is in the + current directory. + Fri Jul 17 11:58:27 1998 Ian Lance Taylor * automake.in: Use $(AM_MAKEFLAGS) in every invocation of $(MAKE). diff --git a/lib/ylwrap b/lib/ylwrap index b5b621843..93bfecd7b 100755 --- a/lib/ylwrap +++ b/lib/ylwrap @@ -50,6 +50,13 @@ case "$input" in ;; esac +# We don't want to use the absolute path if the input in the current +# directory like when making a tar ball. +input_base=`echo $input | sed -e 's|.*/||'` +if test -f $input_base && cmp $input_base $input >/dev/null 2>&1; then + input=$input_base +fi + pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then @@ -67,6 +74,15 @@ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname +case "$input" in + /*) + # Absolute path; do nothing. + ;; + *) + # Make a symbolic link, hard link or hardcopy. + ln -s ../"$input" . > /dev/null 2>&1 || ln ../"$input" . > /dev/null 2>&1 || cp ../"$input" . + ;; +esac $prog ${1+"$@"} "$input" status=$? diff --git a/ylwrap b/ylwrap index b5b621843..93bfecd7b 100755 --- a/ylwrap +++ b/ylwrap @@ -50,6 +50,13 @@ case "$input" in ;; esac +# We don't want to use the absolute path if the input in the current +# directory like when making a tar ball. +input_base=`echo $input | sed -e 's|.*/||'` +if test -f $input_base && cmp $input_base $input >/dev/null 2>&1; then + input=$input_base +fi + pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then @@ -67,6 +74,15 @@ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname +case "$input" in + /*) + # Absolute path; do nothing. + ;; + *) + # Make a symbolic link, hard link or hardcopy. + ln -s ../"$input" . > /dev/null 2>&1 || ln ../"$input" . > /dev/null 2>&1 || cp ../"$input" . + ;; +esac $prog ${1+"$@"} "$input" status=$? -- 2.47.3