Project

General

Profile

Feature #1747

include workspace hash in package metadata and VERSION

Added by Bayard Bell almost 8 years ago. Updated almost 8 years ago.

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:

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.

History

#1

Updated by Bayard Bell almost 8 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.

#2

Updated by Rich Lowe almost 8 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
}

Also available in: Atom PDF