Skip to content
Snippets Groups Projects
Commit 8bd5c704 authored by law's avatar law
Browse files

        * 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.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22945 138bc75d-0d04-0410-961f-82ee72b054a4
parent a8071b4d
No related merge requests found
...@@ -31,7 +31,7 @@ prog="$1" ...@@ -31,7 +31,7 @@ prog="$1"
shift shift
# Make any relative path in $prog absolute. # Make any relative path in $prog absolute.
case "$prog" in case "$prog" in
/*) ;; /* | [A-Za-z]:\\*) ;;
*/*) prog="`pwd`/$prog" ;; */*) prog="`pwd`/$prog" ;;
esac esac
...@@ -39,7 +39,7 @@ esac ...@@ -39,7 +39,7 @@ esac
input="$1" input="$1"
shift shift
case "$input" in case "$input" in
/*) /* | [A-Za-z]:\\*)
# Absolute path; do nothing. # Absolute path; do nothing.
;; ;;
*) *)
...@@ -50,6 +50,13 @@ case "$input" in ...@@ -50,6 +50,13 @@ case "$input" in
;; ;;
esac 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= pairlist=
while test "$#" -ne 0; do while test "$#" -ne 0; do
if test "$1" = "--"; then if test "$1" = "--"; then
...@@ -67,6 +74,15 @@ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 ...@@ -67,6 +74,15 @@ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
mkdir $dirname || exit 1 mkdir $dirname || exit 1
cd $dirname cd $dirname
case "$input" in
/* | [A-Za-z]:\\*)
# 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" $prog ${1+"$@"} "$input"
status=$? status=$?
...@@ -79,7 +95,7 @@ if test $status -eq 0; then ...@@ -79,7 +95,7 @@ if test $status -eq 0; then
# If $2 is an absolute path name, then just use that, # If $2 is an absolute path name, then just use that,
# otherwise prepend `../'. # otherwise prepend `../'.
case "$2" in case "$2" in
/*) target="$2";; /* | [A-Za-z]:\\*) target="$2";;
*) target="../$2";; *) target="../$2";;
esac esac
mv "$1" "$target" || status=$? mv "$1" "$target" || status=$?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment