jjb/common: aglsetup: use topic if available 09/21909/2
authorKevin Hilman <khilman@baylibre.com>
Thu, 18 Jul 2019 16:50:02 +0000 (09:50 -0700)
committerKevin Hilman <khilman@baylibre.com>
Fri, 19 Jul 2019 16:52:45 +0000 (09:52 -0700)
If aglsetup.sh is a new enough version, use the --topic option to set
a unique topic string.

TODO: support release/snapshot builds as well as CI builds.

Bug-AGL: SPEC-2646

Change-Id: I599063f349cc98e3f11b97201edebe7431012dd1
Suggested-by: Stephane Desneux <stephane.desneux@iot.bzh>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
jjb/common/include-agl-source-aglsetup.sh

index 2b010e1..44b6ae6 100644 (file)
@@ -4,9 +4,19 @@
 ################################################################################
 ## Source the aglsetup script
 ################################################################################
+SETUP_OPTS=""
+
+# check aglsetup version
+source meta-agl/scripts/aglsetup.sh --version >/dev/null 2>&1 || AGLSETUP_VERSION=1.0.0
+
+# add setup topic (if new enough version)
+TOPIC_SUPPORT_VER=1.2.0
+if [[ "$(echo -e "$AGLSETUP_VERSION\n$TOPIC_SUPPORT_VER" | sort -V | head -n1)" == $TOPIC_SUPPORT_VER ]]; then
+   SETUP_OPTS="--topic change-${GERRIT_CHANGE_NUMBER}-${GERRIT_PATCHSET_NUMBER}"
+fi
 
 # source the env
-source meta-agl/scripts/aglsetup.sh -m ${MACHINE} -b output ${TARGETFEATURES}
+source meta-agl/scripts/aglsetup.sh ${SETUP_OPTS} -m ${MACHINE} -b output ${TARGETFEATURES}
 
 # link the shared downloads and sstate-cache
 ln -sf ../../downloads