blob: f3b8321901c87912f50aa8ca2ff3a4e92de88133 [file] [log] [blame]
#! /bin/sh
#
# Lifted from Avery's code in buildroot/support/scripts/postbuild.sh
#
PLATFORM_PREFIX=gfiber
tagname=$(git describe)
tagabbrev=$(git describe --abbrev=0)
count=$(git rev-list '$tagabbrev'..HEAD 2>/dev/null | wc -l)
if [ "$count" -gt 0 ]; then
# Tree has commits since last tag, rebuild the image name
version="$PLATFORM_PREFIX-${tagabbrev#*-}-$count-${tagname##*-}"
else
version="$PLATFORM_PREFIX-${tagname#*-}"
fi
echo -n "$version"
if [ "$PROD" != "y" ]; then
(echo -n '-'; whoami | cut -c1-2)
fi