VirtualBox

Changeset 66805 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
May 5, 2017 9:27:08 AM (8 years ago)
Author:
vboxsync
Message:

testboxscript/setup.sh: bash on solaris 10 doesn't grok += array syntax. improved envvar handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testboxscript/setup.sh

    r66800 r66805  
    367367            "--testrsrc-server-passwd") TESTBOXSCRIPT_TESTRSRC_PASSWD="$2"; shift;;
    368368            "--putenv")
    369                 ## @todo remove any existing variable or we'll end up with a pretty long number of putenv statements on solaris.
    370                 TESTBOXSCRIPT_ENVVARS+=("$2");
     369                MY_FOUND=no
     370                MY_VAR=`echo $2 | sed -e 's/=.*$//' `
     371                for i in ${!TESTBOXSCRIPT_ENVVARS[@]};
     372                do
     373                    MY_CURVAR=`echo "${TESTBOXSCRIPT_ENVVARS[i]}" | sed -e 's/=.*$//' `
     374                    if [ -n "${MY_CURVAR}" -a  "${MY_CURVAR}" = "${MY_VAR}" ]; then
     375                        TESTBOXSCRIPT_ENVVARS[$i]="$2"
     376                        MY_FOUND=yes
     377                    fi
     378                done
     379                if [ "${MY_FOUND}" = "no" ]; then
     380                    TESTBOXSCRIPT_ENVVARS=( "${TESTBOXSCRIPT_ENVVARS[@]}" "$2" );
     381                fi
    371382                shift;;
    372383            --*)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette