jim 98/08/03 14:51:41
Modified: src CHANGES src/helpers PrintPath PrintPathOS2 TestCompile Log: Update PrintPath family... Revision Changes Path 1.1001 +5 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1000 retrieving revision 1.1001 diff -u -r1.1000 -r1.1001 --- CHANGES 1998/08/03 19:59:55 1.1000 +++ CHANGES 1998/08/03 21:51:37 1.1001 @@ -1,5 +1,10 @@ Changes with Apache 1.3.2 + *) Cleanup of the PrintPath/PrintPathOS2 helper functions. Avoid + the ugly use of an env. variable and use command-line args for + alternate $PATH. Make more like advanced 'type's as well. + [Jim Jagielski] + *) The IRIXN32 Rule was being ignored. Configure now correctly adds -n32 only if IRIXN32 says to. [Jim Jagielski, Alain St-Denis <[EMAIL PROTECTED]>] PR#2736 1.11 +44 -26 apache-1.3/src/helpers/PrintPath Index: PrintPath =================================================================== RCS file: /export/home/cvs/apache-1.3/src/helpers/PrintPath,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- PrintPath 1998/04/11 15:45:59 1.10 +++ PrintPath 1998/08/03 21:51:40 1.11 @@ -1,18 +1,43 @@ #!/bin/sh -# Look for $1 somewhere in $PATH. As an extra bonus, -# if $AP_PPSEARCHPATH is set, this will look for $i -# in there instead. Will print out the full pathname unless -# called with the '-s' option +# Look for program[s] somewhere in $PATH. # +# Options: +# -s +# Do not print out full pathname. (silent) +# -pPATHNAME +# Look in PATHNAME instead of $PATH +# +# Usage: +# PrintPath [-s] [-pPATHNAME] program [program ...] +# +## +# Some "constants" +## +pathname=$PATH +echo="yes" + +## +# Parse command line +## +for args in $* +do + case $args in + -s ) echo="no" ;; + -p* ) pathname="`echo $args | sed 's/^..//'`" ;; + * ) programs="$programs $args" ;; + esac +done + +## # We do some funny stuff to check to see # if test/[] knows about -x -# +## testfile="pp.t.$$" cat > $testfile <<ENDTEST #!/bin/sh if [ -x / ] || [ -x /bin ] || [ -x /bin/ls ]; then - exit 0 + exit 0 fi exit 1 ENDTEST @@ -23,29 +48,22 @@ test_exec_flag="-r" fi rm -f $testfile - -if [ "x$1" = "x-s" ]; then - shift -else - echo="yes" -fi - -if [ "x$AP_PPSEARCHPATH" = "x" ] ; then - AP_PPSEARCHPATH=$PATH -fi -for path in `echo $AP_PPSEARCHPATH | - sed 's/^:/.:/ - s/::/:.:/g - s/:$/:./ - s/:/ /g' ` +for program in $programs do - if [ $test_exec_flag $path/$1 ] && [ ! -d $path/$1 ]; then - if [ "$echo" = "yes" ]; then - echo $path/$1 + for path in `echo $pathname | + sed 's/^:/.:/ + s/::/:.:/g + s/:$/:./ + s/:/ /g' ` + do + if [ $test_exec_flag $path/$program ] && [ ! -d $path/$program ]; then + if [ "$echo" = "yes" ]; then + echo $path/$program + fi + exit 0 fi - exit 0 - fi + done done exit 1 1.4 +40 -24 apache-1.3/src/helpers/PrintPathOS2 Index: PrintPathOS2 =================================================================== RCS file: /export/home/cvs/apache-1.3/src/helpers/PrintPathOS2,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PrintPathOS2 1998/04/11 15:45:59 1.3 +++ PrintPathOS2 1998/08/03 21:51:40 1.4 @@ -1,33 +1,49 @@ #!/bin/sh -# Look for $1 somewhere in $PATH. As an extra bonus, -# if $AP_PPSEARCHPATH is set, this will look for $i -# in there instead. Will print out the full pathname unless -# called with the '-s' option +# Look for program[s] somewhere in $PATH. # - -if [ "x$1" = "x-s" ]; then - shift -else - echo="yes" -fi +# Options: +# -s +# Do not print out full pathname. (silent) +# -pPATHNAME +# Look in PATHNAME instead of $PATH +# +# Usage: +# PrintPath [-s] [-pPATHNAME] program [program ...] +# +## +# Some "constants" +## +pathname=$PATH +echo="yes" -if [ "x$AP_PPSEARCHPATH" = "x" ] ; then - AP_PPSEARCHPATH=$PATH -fi +## +# Parse command line +## +for args in $* +do + case $args in + -s ) echo="no" ;; + -p* ) pathname="`echo $args | sed 's/^..//'`" ;; + * ) programs="$programs $args" ;; + esac +done -for path in `echo $AP_PPSEARCHPATH | - sed 's/^;/.;/ - s/;;/;.;/g - s/;$/;./ - s/;/ /g - s/\\\\/\\//g' ` +for program in $programs do - if [ -r $path/$1.exe ] && [ ! -d $path/$1.exe ]; then - if [ "$echo" = "yes" ]; then - echo $path/$1.exe + for path in `echo $pathname | + sed 's/^;/.;/ + s/;;/;.;/g + s/;$/;./ + s/;/ /g + s/\\\\/\\//g' ` + do + if [ -r $path/$program.exe ] && [ ! -d $path/$program.exe ]; then + if [ "$echo" = "yes" ]; then + echo $path/$program.exe + fi + exit 0 fi - exit 0 - fi + done done exit 1 1.14 +2 -3 apache-1.3/src/helpers/TestCompile Index: TestCompile =================================================================== RCS file: /export/home/cvs/apache-1.3/src/helpers/TestCompile,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- TestCompile 1998/07/18 15:30:41 1.13 +++ TestCompile 1998/08/03 21:51:40 1.14 @@ -145,13 +145,12 @@ # Use our PrintPath helper script, knowing that we have # 2 versions of it though... Configure should set AP_PRINTPATH # but if not, just assume we use our "generic" version. We -# also use the AP_PPSEARCHPATH "hack" to have PrintPath -# just search this directory. +# also use the "-p" option to have PrintPath just search this directory. if [ "x$AP_PRINTPATH" = "x" ] ; then AP_PRINTPATH=PrintPath fi -if AP_PPSEARCHPATH=`pwd` ./$AP_PRINTPATH -s $TARGET ; then +if ./$AP_PRINTPATH -s -p`pwd` $TARGET ; then exstat=0 fi