summaryrefslogtreecommitdiffstats
path: root/make_version.sh
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2015-07-29 15:25:53 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-07-31 15:32:44 +1000
commit3591fd399c7d76b54ac25075b7617fe9b7de3507 (patch)
treecc003a59e32c18308afa1736f6ebb6e343640c82 /make_version.sh
parent869228384267a2a4f23e563879e2a1f4b16f376e (diff)
downloadtalos-skiboot-3591fd399c7d76b54ac25075b7617fe9b7de3507.tar.gz
talos-skiboot-3591fd399c7d76b54ac25075b7617fe9b7de3507.zip
versioning: Unify all versioning to match skiboot versions
Previously there has been some uncertainty as to how separate binaries were to be versioned compared to the firmware version as they could change (or not change) out of sync with skiboot versioning. Historically pflash was born with its own version which didn't help the issue. It has been decided that make_version.sh should always return one version which is shall be the skiboot firmware version, external binaries can supply their own prefix which will be s/skiboot/$prefix/ but the default behaviour is the git tag versioning. The main reason for versioning here is so developers can identify which version of the code someone is running, versions which closly match the source tree are easiest to deal with. The idea with one version and every binary getting a bump regardless of changes is that there is a lot of shared code (libflash/libffs are a prime example) and even if an external binary isn't explicitly updated it is possible that changes to shared code may be missed. This patch simplifies make_version.sh which had been updated to deal with pflash- git tags. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'make_version.sh')
-rwxr-xr-xmake_version.sh37
1 files changed, 15 insertions, 22 deletions
diff --git a/make_version.sh b/make_version.sh
index 95058cb9..15aed6be 100755
--- a/make_version.sh
+++ b/make_version.sh
@@ -1,35 +1,23 @@
#!/bin/bash
usage() {
- echo "$0 git-tag-prefix"
- echo -e "\tIf inside git dir specify a tag prefix to use."
- echo -e "\tWhere a prefix is anything before the first dash '-' character."
+ echo "$0 [ prefix ]"
+ echo -e "\t Optionally specify a prefix other than 'skiboot'"
echo
- if test -d .git || git rev-parse --is-inside-work-tree > /dev/null 2>&1;
- then
- echo "Possible tags include:"
- git tag | cut -d '-' -f 1 | sort | uniq
- fi
}
-if test -e .git || git rev-parse --is-inside-work-tree > /dev/null 2>&1;
+if [ "$1" = "-h" -o "$1" = "--help" ] ;
then
- if [ $# -ne "1" ] ; then
- usage
- exit 1;
- fi
-
- TAG_PREFIX="$1"
-
- #Check that there is at least one of such a prefix
- if ! git tag | grep -q "$TAG_PREFIX" ; then
- echo -e "There isn't a single gix tag with prefix '$TAG_PREFIX'\n" > stderr
- fi
+ usage
+ exit 1;
+fi
- version=`git describe --exact-match --match "$TAG_PREFIX-*" 2>/dev/null`
+if test -e .git || git rev-parse --is-inside-work-tree > /dev/null 2>&1;
+then
+ version=`git describe --exact-match 2>/dev/null`
if [ -z "$version" ];
then
- version=`git describe --match "$TAG_PREFIX-*" 2>/dev/null`
+ version=`git describe 2>/dev/null`
fi
if [ -z "$version" ];
then
@@ -51,6 +39,11 @@ then
version="$version-$diffsha"
fi
+ if [ $# -eq 1 ];
+ then
+ version=`echo $version | sed s/skiboot/$1/`
+ fi
+
echo $version
else
if [ ! -z "$SKIBOOT_VERSION" ];
OpenPOWER on IntegriCloud