[meta-freescale] [fsl-community-bsp-base][PATCH] setup-environment: fix EULA acceptance logic
Mario Domenech Goulart
mario at ossystems.com.br
Wed Aug 19 10:11:47 PDT 2015
This commit fixes the handling of the EULA environment variable,
which was being ignored. This regression was introduced by
Assumption by this commit: variables are considered set if they are
set according to shell's rules.
. setup-environment <build-dir>
(assuming EULA is not set in the current environment) or
EULA= . setup-environment <build-dir>
won't make the FSL EULA be automatically accepted. However,
EULA=1 . setup-environment <build-dir>
will, as well as for any value of EULA.
The same rules apply to ACCEPT_FSL_EULA configuration in
Signed-off-by: Mario Domenech Goulart <mario at ossystems.com.br>
setup-environment | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/setup-environment b/setup-environment
index 9abb572..436a932 100755
@@ -179,11 +179,26 @@ EOF
# Handle EULA setting
-if [ -z "$EULA" ] && ! grep -q '^ACCEPT_FSL_EULA\s*=' conf/local.conf; then
+# EULA has been accepted already (ACCEPT_FSL_EULA is set in local.conf)
+if grep -q '^\s*ACCEPT_FSL_EULA\s*=\s*["'\'']..*["'\'']' conf/local.conf; then
-if [ "$EULA" = "ask" ]; then
+if [ -z "$EULA_ACCEPTED" ] && [ -n "$EULA" ]; then
+ # The FSL EULA is not set as accepted in local.conf, but the EULA
+ # variable is set in the environment, so we just configure
+ # ACCEPT_FSL_EULA in local.conf according to $EULA.
+ echo "ACCEPT_FSL_EULA = \"$EULA\"" >> conf/local.conf
+elif [ -n "$EULA_ACCEPTED" ]; then
+ # The FSL EULA has been accepted once, so ACCEPT_FSL_EULA is set
+ # in local.conf. No need to do anything.
+ # THE FSL EULA is not set as accepted in local.conf, and EULA is
+ # not set in the environment, so we need to ask user if he/she
+ # accepts the FSL EULA:
Some BSPs depend on libraries and packages which are covered by Freescale's
@@ -196,26 +211,23 @@ EOF
more -d $CWD/sources/meta-fsl-arm/EULA
- while [ "$EULA" = "ask" ]; do
+ while [ -z "$REPLY" ]; do
echo -n "Do you accept the EULA you just read? (y/n) "
case "$REPLY" in
echo "EULA has been accepted."
+ echo "ACCEPT_FSL_EULA = \"1\"" >> conf/local.conf
echo "EULA has not been accepted."
- if grep -q '^ACCEPT_FSL_EULA\s*=' conf/local.conf; then
- sed -i "s/^#*ACCEPT_FSL_EULA\s*=.*/ACCEPT_FSL_EULA = \"$EULA\"/g" conf/local.conf
- echo "ACCEPT_FSL_EULA = \"$EULA\"" >> conf/local.conf
More information about the meta-freescale