caam

changeset 8:81966c752db4

Fix -n option.
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 20 Mar 2012 19:32:00 +0900
parents e0df1e3dbce0
children 8e5c505a624a
files bin/caam
diffstat 1 files changed, 8 insertions(+), 9 deletions(-) [+]
line diff
     1.1 --- a/bin/caam	Wed Feb 22 10:58:38 2012 +0900
     1.2 +++ b/bin/caam	Tue Mar 20 19:32:00 2012 +0900
     1.3 @@ -1,8 +1,8 @@
     1.4  #!/bin/sh
     1.5  # caam - Configure And And Make
     1.6 -# (C)2008-2011 by HIROSE, Yuuji [yuuji/at/gentei.org]
     1.7 -# Last modified Wed Feb 22 10:53:24 2012 on firestorm
     1.8 -# Update count: 35
     1.9 +# (C)2008-2012 by HIROSE, Yuuji [yuuji/at/gentei.org]
    1.10 +# Last modified Tue Mar 20 17:01:16 2012 on firestorm
    1.11 +# Update count: 39
    1.12  # http://www.gentei.org/~yuuji/software/caam/
    1.13  
    1.14  ca=`echo $CAAM_ADD|tr : ' '`
    1.15 @@ -160,13 +160,12 @@
    1.16     cat <<EOF
    1.17  if [ x"\`uname -sm\`" = x"$uname" ]; then
    1.18    if [ x"\$1" = x"-n" ]; then
    1.19 -    shift; DO() {
    1.20 -      echo "\$@"|sed "s,\$PATH,\\\$PATH,"|sed 's/PATH=\\\$PATH //'
    1.21 -    }
    1.22 -  else
    1.23 -    DO() { eval "\$@";}
    1.24 +    sed -n -e '1,/#[:]BEGIN/d' -e '/^  exit\$/q' -e p \$0 \\
    1.25 +      | sed -e 's/^  *//' -e 's/ "\$@"//' \\
    1.26 +      | sed "s,\$PATH,\\\$PATH,"|sed '/PATH="\\\$PATH" /d'
    1.27 +    exit 0
    1.28    fi
    1.29 -  DO \\
    1.30 +  #:BEGIN
    1.31  EOF
    1.32     for e in $kept_env; do
    1.33       eval v="\$old_$e"