aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Andersson <gandersson@genivi.org>2018-04-25 10:29:53 +0200
committerOscar Andreasson <oan@frozentux.net>2018-05-18 08:42:50 +0200
commitd24c976711449388cf234b7533582b9e1a7f2cf5 (patch)
tree55e96e7d380054d06639eb5bf1eb72972370c38f
parent3a0785f66f67e43b7a19e342f68581efea9f8e10 (diff)
downloadmeta-ivi-d24c976711449388cf234b7533582b9e1a7f2cf5.tar.gz
meta-ivi-d24c976711449388cf234b7533582b9e1a7f2cf5.tar.bz2
meta-ivi-d24c976711449388cf234b7533582b9e1a7f2cf5.zip
ci-build: Avoid multiple appends to conf files
Signed-off-by: Gunnar Andersson <gandersson@genivi.org>
-rwxr-xr-xscripts/ci-build.sh30
1 files changed, 17 insertions, 13 deletions
diff --git a/scripts/ci-build.sh b/scripts/ci-build.sh
index 2a1ed11..1cc06ea 100755
--- a/scripts/ci-build.sh
+++ b/scripts/ci-build.sh
@@ -66,10 +66,14 @@ stop_immediately() {
append_local_conf() {
LOCAL_CONF="$BASEDIR/build/conf/local.conf"
if [[ -f "$LOCAL_CONF" ]]; then
- echo -n "Appending to local.conf: "
+ if fgrep -q "$1" ; then
+ echo "Found variable ($1) in local conf - skipping append"
+ else
+ echo -n "Appending to local.conf: "
cat <<EOT | tee -a "$LOCAL_CONF"
-$1
+$2
EOT
+ fi
else
echo "Fatal: Did not find local.conf where expected"
stop_immediately
@@ -412,34 +416,34 @@ done
# should be quite self-explanatory.
if [[ "$RM_WORK" == "true" ]]; then
- append_local_conf 'INHERIT += "rm_work"'
+ append_local_conf rm_work 'INHERIT += "rm_work"'
fi
if [[ -n "$DL_DIR" ]]; then
- append_local_conf "DL_DIR = \"$DL_DIR\""
+ append_local_conf DL_DIR "DL_DIR = \"$DL_DIR\""
fi
if [[ -n "$SSTATE_DIR" ]]; then
- append_local_conf "SSTATE_DIR = \"$SSTATE_DIR\""
+ append_local_conf SSTATE_DIR "SSTATE_DIR = \"$SSTATE_DIR\""
fi
if [[ -n "$BB_NUMBER_THREADS" ]]; then
- append_local_conf "BB_NUMBER_THREADS = \"$BB_NUMBER_THREADS\""
+ append_local_conf BB_NUMBER_THREADS "BB_NUMBER_THREADS = \"$BB_NUMBER_THREADS\""
fi
if [[ -n "$PARALLEL_MAKE" ]]; then
echo $PARALLEL_MAKE | egrep -q '^-j' || PARALLEL_MAKE="-j$PARALLEL_MAKE"
- append_local_conf "PARALLEL_MAKE = \"$PARALLEL_MAKE\""
+ append_local_conf PARALLEL_MAKE "PARALLEL_MAKE = \"$PARALLEL_MAKE\""
fi
if [[ "$SOURCE_ARCHIVE" == "true" ]]; then
- append_local_conf 'INHERIT += "archiver"'
- append_local_conf 'ARCHIVER_MODE[src] = "original"'
+ append_local_conf ARCHIVER_MODE 'INHERIT += "archiver"'
+ append_local_conf ARCHIVER_MODE 'ARCHIVER_MODE[src] = "original"'
fi
if [[ "$COPY_LICENSES" == "true" ]]; then
- append_local_conf 'COPY_LIC_DIRS = "1"'
- append_local_conf 'COPY_LIC_MANIFEST = "1"'
+ append_local_conf COPY_LIC_DIRS 'COPY_LIC_DIRS = "1"'
+ append_local_conf COPY_LIC_MANIFEST 'COPY_LIC_MANIFEST = "1"'
fi
# The own-mirrors bbclass is generally more convenient for PREMIRRORS, but
@@ -450,7 +454,7 @@ fi
# is checked, if the user had defined any other in conf files.
if [[ -n "$PREMIRROR" ]]; then
- append_local_conf "
+ append_local_conf PREMIRRORS_prepend "
PREMIRRORS_prepend = \"\\
git://.*/.* $PREMIRROR \\n \\
ftp://.*/.* $PREMIRROR \\n \\
@@ -464,7 +468,7 @@ fi
# WE *app*pend MIRROR because we want it to be the last mirror that is checked,
# if the user had defined others in conf files.
if [[ -n "$MIRROR" ]]; then
- append_local_conf "
+ append_local_conf MIRRORS_append "
MIRRORS_append = \"\\
git://.*/.* $MIRROR \\n \\
ftp://.*/.* $MIRROR \\n \\