libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: fallback to $PATH if progpath has no directory component [libtool--


From: Gary V. Vaughan
Subject: FYI: fallback to $PATH if progpath has no directory component [libtool--release--2.0--patch-15]
Date: Fri, 8 Oct 2004 16:51:53 +0100 (BST)
User-agent: mailnotify/0.4

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Applied to branch-2-0.

  * looking for address@hidden/libtool--release--2.0--patch-14 to compare with
  * comparing to address@hidden/libtool--release--2.0--patch-14
  M  ChangeLog
  M  config/general.m4sh
  
  * modified files
  
  Index: Changelog
  from  Gary V. Vaughan  <address@hidden>
  
        Fix some issues that mangled the reexecution path to a script,
        and thus prevented it from finding itself:
  
        * config/general.m4sh (progname): Don't actually change the name
        of the script if it begins with a `-', just prepend `./'.
        (progpath): Add a new clause that first searches the execution
        PATH, and then finally assumes this script is in the current
        working directory if $progname has no directory separators (e.g
        when invoked as `$SHELL progname').
  
  --- orig/config/general.m4sh
  +++ mod/config/general.m4sh
  @@ -62,14 +62,26 @@
   
   # The name of this program:
   # In the unlikely event $progname began with a '-', it would play havoc with
  -# func_echo (imagine progname=-n), so we substitute for _ in that case.
  -progname=`$ECHO "X$progpath" | $Xsed -e "$basename" -e 's,^-,_,'`
  +# func_echo (imagine progname=-n), so we prepend ./ in that case:
  +progname=`$ECHO "X$progpath" | $Xsed -e "$basename" -e 's,^-,./-,'`
   
   # Make sure we have an absolute path for reexecution:
   case $progpath in
     [[\\/]]*|[[A-Za-z]]:\\*) ;;
  -  *) progdir=`$ECHO "X$progpath" | $Xsed -e "$dirname"`
  +  *[[\\/]]*)
  +     progdir=`$ECHO "X$progpath" | $Xsed -e "$dirname"`
        progdir=`cd "$progdir" && pwd`
  +     progpath="$progdir/$progname"
  +     ;;
  +  *)
  +     save_IFS="$IFS"
  +     IFS=:
  +     for progdir in $PATH; do
  +       IFS="$save_IFS"
  +       test -x "$progdir/$progname" && break
  +     done
  +     IFS="$save_IFS"
  +     test -n "$progdir" || progdir=`pwd`
        progpath="$progdir/$progname"
        ;;
   esac
  
  
  
- -- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
_________________________________________________________
This patch notification generated by tlaapply version 0.7
http://tkd.kicks-ass.net/arch/address@hidden/cvs-utils--tla--1.0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFBZreYFRMICSmD1gYRAuGKAJ9YScFCg47GZP1W+qJFTQ+ti6Js8gCfZBOn
tIND9GdR2EIKaaCyj2smSXc=
=tuak
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]