aglsetup: add -t|--topic and -V|--version options 92/21892/3
authorStephane Desneux <stephane.desneux@iot.bzh>
Tue, 16 Jul 2019 17:23:50 +0000 (17:23 +0000)
committerStephane Desneux <stephane.desneux@iot.bzh>
Sat, 20 Jul 2019 11:21:42 +0000 (11:21 +0000)
commit8cbd61a838bfa3f46f66b5641c27c0492ceba2d8
tree184d15901f766342089275ed9a570d56d18f4380
parentd90dd1a4aa6fb62a69c74e9e824977351ef9f8c4
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 <stephane.desneux@iot.bzh>
scripts/.aglsetup_genconfig.bash
scripts/aglsetup.sh
scripts/distro-manifest-generator.sh