Feature #1747
include workspace hash in package metadata and VERSION
Status:
New
Priority:
Normal
Assignee:
-
Category:
tools - gate/build tools
Start date:
2011-11-08
Due date:
% Done:
0%
Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
Description
Rather than using workspace names, it would be far easier to handle bug reports and other clearly identify non-tagged builds if VERSION defaulted to using the workspace hash (hg id/hg id -i or git describe --always). Similarly, for packages, it would be useful to include similar output so that it was absolutely clear which source was used.
Updated by Bayard Bell about 9 years ago
Given that people are building with both mercurial and git, there should be an SCM identifier (e.g. an "h" or "g" prefix) so that it's clear which system generated the hashes.
Updated by Rich Lowe about 9 years ago
I use
function scm_version { if [[ -d $CODEMGR_WS/.hg ]]; then hg parent --template="{tags} {node|short}\n" | \ nawk 'NF > 1 && $1 != "tip" { printf "%s-%s", $1, $NF; exit } { printf "%s-%s", ENVIRON["GATE"], $2 }' elif [[ -d $CODEMGR_WS/.git ]]; then git describe --long --all HEAD | cut -d/ -f2- else echo "${GATE}:$(date +'%Y-%m-%d')" fi }