summaryrefslogtreecommitdiffstats
path: root/ylwrap
diff options
context:
space:
mode:
authorMarc Lehmann <pcg@goof.com>1998-10-08 17:26:54 -0600
committerJeff Law <law@gcc.gnu.org>1998-10-08 17:26:54 -0600
commit9f2f70f40485e9a96342c15f1a958343b489919b (patch)
tree8644cbbbbf1a1412a83ba7c7ab9d65b6ba351c14 /ylwrap
parentylwrap: Change absolute path checks to check for DOS style path names. (diff)
downloadgcc-9f2f70f40485e9a96342c15f1a958343b489919b.tar.gz
gcc-9f2f70f40485e9a96342c15f1a958343b489919b.tar.bz2
gcc-9f2f70f40485e9a96342c15f1a958343b489919b.tar.xz
ylwrap: Change absolute path checks to check for DOS style path names.
� * ylwrap: Change absolute path checks to check for DOS style path names. * ylwrap: Don't use a full path name if the source file is in the same directory. From hjl@lucon.org (H.J. Lu). Brought over from devo. From-SVN: r22945
Diffstat (limited to 'ylwrap')
-rwxr-xr-xylwrap22
1 files changed, 19 insertions, 3 deletions
diff --git a/ylwrap b/ylwrap
index b5b62184383..2288ccde3ac 100755
--- a/ylwrap
+++ b/ylwrap
@@ -31,7 +31,7 @@ prog="$1"
31shift 31shift
32# Make any relative path in $prog absolute. 32# Make any relative path in $prog absolute.
33case "$prog" in 33case "$prog" in
34 /*) ;; 34 /* | [A-Za-z]:\\*) ;;
35 */*) prog="`pwd`/$prog" ;; 35 */*) prog="`pwd`/$prog" ;;
36esac 36esac
37 37
@@ -39,7 +39,7 @@ esac
39input="$1" 39input="$1"
40shift 40shift
41case "$input" in 41case "$input" in
42 /*) 42 /* | [A-Za-z]:\\*)
43 # Absolute path; do nothing. 43 # Absolute path; do nothing.
44 ;; 44 ;;
45 *) 45 *)
@@ -50,6 +50,13 @@ case "$input" in
50 ;; 50 ;;
51esac 51esac
52 52
53# We don't want to use the absolute path if the input in the current
54# directory like when making a tar ball.
55input_base=`echo $input | sed -e 's|.*/||'`
56if test -f $input_base && cmp $input_base $input >/dev/null 2>&1; then
57 input=$input_base
58fi
59
53pairlist= 60pairlist=
54while test "$#" -ne 0; do 61while test "$#" -ne 0; do
55 if test "$1" = "--"; then 62 if test "$1" = "--"; then
@@ -67,6 +74,15 @@ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
67mkdir $dirname || exit 1 74mkdir $dirname || exit 1
68 75
69cd $dirname 76cd $dirname
77case "$input" in
78 /* | [A-Za-z]:\\*)
79 # Absolute path; do nothing.
80 ;;
81 *)
82 # Make a symbolic link, hard link or hardcopy.
83 ln -s ../"$input" . > /dev/null 2>&1 || ln ../"$input" . > /dev/null 2>&1 || cp ../"$input" .
84 ;;
85esac
70$prog ${1+"$@"} "$input" 86$prog ${1+"$@"} "$input"
71status=$? 87status=$?
72 88
@@ -79,7 +95,7 @@ if test $status -eq 0; then
79 # If $2 is an absolute path name, then just use that, 95 # If $2 is an absolute path name, then just use that,
80 # otherwise prepend `../'. 96 # otherwise prepend `../'.
81 case "$2" in 97 case "$2" in
82 /*) target="$2";; 98 /* | [A-Za-z]:\\*) target="$2";;
83 *) target="../$2";; 99 *) target="../$2";;
84 esac 100 esac
85 mv "$1" "$target" || status=$? 101 mv "$1" "$target" || status=$?