From 8cbd61a838bfa3f46f66b5641c27c0492ceba2d8 Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Tue, 16 Jul 2019 17:23:50 +0000 Subject: aglsetup: add -t|--topic and -V|--version options New options are: * -t|--topic : add a 'topic' to current setup (default: empty) * -V|--version : display aglsetup version The topic value can be any string and it is propagated to aglsetup.manifest, which in turn is used by distro-build-manifest to put it in DIST_BUILD_TOPIC variable in all build manifests (deploy dir, target image, sdk) Using the --topic option to specify a unique identifier will help to provide a common ID for all builds in the same "family" even if features and layers differ. For this purpose, a topic could be: * a gerrit review id + a patchset number * a project name (git repo) + a Change-Id * a random UUID * ... When run with -V or --version, aglsetup writes its version on stdout and sets the variable AGLSETUP_VERSION then exits. As aglsetup can only be called by being sourced, the AGLSETUP_VERSION variable is finally set in the caller environment. The version can be used for various purposes. The immediate goal is to detect if --topic option is supported or not. Bug-AGL: SPEC-2646 Change-Id: I0b68dfa297509dac07e9b2942948631cfc13c319 Signed-off-by: Stephane Desneux --- scripts/aglsetup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/aglsetup.sh') diff --git a/scripts/aglsetup.sh b/scripts/aglsetup.sh index 21a1e8070..3bb6e0cde 100644 --- a/scripts/aglsetup.sh +++ b/scripts/aglsetup.sh @@ -39,7 +39,7 @@ if [ $SOURCED -ne 1 ]; then unset SOURCEDIR echo "Error: this script needs to be sourced in a supported shell" >&2 echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 '" >&2 - return 1 + exit 56 else unset SOURCED tmpfile=$(mktemp /tmp/aglsetup.XXXXXXXX) -- cgit 1.2.3-korg