diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-11-04 11:21:38 -0700 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-11-04 11:21:38 -0700 |
commit | c35b4a0846ea9867ed1eeea94a465019a22b6b6c (patch) | |
tree | ccc8da121f37eaf854900396015d0e37f118304c /bin/sed | |
parent | 3620e5ee5e3e32b592c949b18d2fc06f58024590 (diff) | |
download | openembedded-c35b4a0846ea9867ed1eeea94a465019a22b6b6c.tar.gz |
bin/{cp,sed}: simplify, consolidate
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'bin/sed')
-rwxr-xr-x | bin/sed | 43 |
1 files changed, 4 insertions, 39 deletions
@@ -21,40 +21,7 @@ # to reimplement -i internally in this script on some platforms. -realbin() { - _script=`basename $0` - found= - for bin in `which -a $_script`; do - if ! cmp -s $bin $0; then - found=$bin - break - fi - done - if [ -n "$found" ]; then - echo "$found" - else - return 1 - fi -} - -quote(){ - /usr/bin/sed -e "s,','\\\\'',g; 1s,^,',; \$s,\$,',;" << EOF -$1 -EOF -} - -save () { - case "$1" in - # when a string contains a "'" we have to escape it - *\'*) - saved="$saved `quote "$1"`" - ;; - # otherwise just quote the variable - *) - saved="$saved '$1'" - ;; - esac -} +source $(dirname $0)/wrapper.sh case `uname -s` in Darwin) @@ -80,15 +47,14 @@ while getopts ne:f:$getopt_os opt; do save "$OPTARG" ;; i) - saved="$saved $inplace_arg" + save "$inplace_arg" continue ;; r) - saved="$saved $extended_re_arg" + save "$extended_re_arg" continue ;; \?) - echo >&2 "Unsupported argument: $OPTARG" exit 1 ;; esac @@ -98,5 +64,4 @@ for arg; do save "$arg" done -eval set -- "$saved" -exec `realbin` "$@" +exec_real |