diff options
author | Daniel Joseph Barnhart Clark <dclark@pobox.com> | 2006-08-25 17:45:05 +0000 |
---|---|---|
committer | Daniel Joseph Barnhart Clark <dclark@pobox.com> | 2006-08-25 17:45:05 +0000 |
commit | b48a91771393816d04f4c31627e577c186ce8387 (patch) | |
tree | 4bc3b1f07fa9c0ecbb53dd41b19aeff1b1feedc4 /encap/src/encap-profiles | |
parent | 55f7a574065f9f1d5a27982279f90a99b7e4dd54 (diff) | |
download | bcfg2-b48a91771393816d04f4c31627e577c186ce8387.tar.gz bcfg2-b48a91771393816d04f4c31627e577c186ce8387.tar.bz2 bcfg2-b48a91771393816d04f4c31627e577c186ce8387.zip |
EncapPackages: ep2target shell portability changes. Still doesn't work with solaris sed.
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2112 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'encap/src/encap-profiles')
-rwxr-xr-x | encap/src/encap-profiles/ep2target | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/encap/src/encap-profiles/ep2target b/encap/src/encap-profiles/ep2target index 31beb6e79..1fc8dc816 100755 --- a/encap/src/encap-profiles/ep2target +++ b/encap/src/encap-profiles/ep2target @@ -1,24 +1,27 @@ #!/bin/sh +SED="sed" +#SED="/opt/csw/bin/gsed" + chomp() { - printf "$1" | sed s:^\ ::g | sed s:\ $::g + printf "$1" | ${SED} 's:^\ ::g' | ${SED} 's:\ $::g' } cname() { unset CTMP1 CTMP2 - for PART in $(printf "$1" | sed s:-:\ :g); do - if [ ! "`printf $PART | cut -c1 | sed s:[0-9]:0:g`x" = "0x" ]; then + for PART in `printf "$1" | ${SED} 's:-:\ :g'`; do + if [ ! "`printf $PART | cut -c1 | ${SED} 's:[0-9]:0:g'`x" = "0x" ]; then CTMP1="${CTMP1} ${PART}" fi done - CTMP2="`chomp "$CTMP1" | sed s:\ :_:g | sed s:\+:X:g | tr [a-z] [A-Z]`" + CTMP2="`chomp "$CTMP1" | ${SED} 's:\ :_:g' | ${SED} 's:\+:X:g' | tr [a-z] [A-Z]`" printf "\$(%s)%s" "`basename "$CTMP2"`" "$2" } builddeps() { unset DEPSTMP for LINE in `grep "<prereq package=\"" $1 \ - | sed s/\ //g \ + | ${SED} 's/\ //g' \ | awk -F\" '{print $2}'`; do DEPSTMP="${DEPSTMP} `cname $LINE $2`" done |