From 50aeb94dbce27115cb17dd09dc8cf6d344a60934 Mon Sep 17 00:00:00 2001
From: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
Date: Mon, 1 Mar 2021 09:06:33 +0100
Subject: [PATCH] Refactor and fix Freescale EULA logic

This fixes:

    $ test "$ACCEPT_FSL_EULA" -eq 1 && echo 'ACCEPT_FSL_EULA = "1"' >> conf/local.conf
    /usr/bin/bash: line 155: test: : integer expression expected

To avoid the problem and reduce complexity, move the Freescale-specific
logic to the only build that requires it.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
---
 .ostc-ci/gitlab-ci.yml | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/.ostc-ci/gitlab-ci.yml b/.ostc-ci/gitlab-ci.yml
index b032419c..571a17c2 100644
--- a/.ostc-ci/gitlab-ci.yml
+++ b/.ostc-ci/gitlab-ci.yml
@@ -127,10 +127,6 @@ reuse:
     # devtool and other related tools.
     # xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
-    # Accept NXP license only for building targets that require proprietary
-    # resources to boot.
-    - test "$ACCEPT_FSL_EULA" -eq 1 && echo 'ACCEPT_FSL_EULA = "1"' >> conf/local.conf 
-
   after_script:
     # If the primary script failed early enough, the scratch dir may not have
     # been created yet. Check for that to avoid confusing errors.
@@ -184,7 +180,6 @@ reuse:
     OHOS_BUILD_FLAVOUR: "linux"
     OHOS_RECIPE_NAME: "openharmony-image-base-tests"
     OHOS_GIT_REPO_PATH: "meta-ohos"
-    ACCEPT_FSL_EULA: 0
 
 "Qemu x86-64 (Linux)":
   extends: .build-linux
@@ -200,7 +195,13 @@ reuse:
   extends: .build-linux
   variables:
     MACHINE: seco-imx8mm-c61
-    ACCEPT_FSL_EULA: 1
+  script:
+    - *workspace-do
+    # Accept NXP license only for building targets that require proprietary
+    # resources to boot.
+    - echo 'ACCEPT_FSL_EULA = "1"' >> "$SCRATCH_DIR"/workspace/build/conf/local.conf
+    # Build the desired recipe.
+    - time bitbake "$OHOS_RECIPE_NAME"
 
 "96Boards Avenger96 (Linux)":
   extends: .build-linux
-- 
GitLab