#! /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 |