pyghmi/makesetup
Jarrod Johnson 74b2e6da48 Modify build for snap versions
Snapshots need to be treated special by various distributions

Change-Id: I158cb713548920c5a45790bce00c97f2e00a8f32
2024-09-04 12:22:27 -04:00

15 lines
460 B
Bash
Executable File

#!/bin/sh
cd `dirname $0`
VERSION=`git describe|cut -d- -f 1`
NUMCOMMITS=`git describe|cut -d- -f 2`
if [ "$NUMCOMMITS" != "$VERSION" ]; then
LASTNUM=$(echo $VERSION|rev|cut -d . -f 1|rev)
LASTNUM=$((LASTNUM+1))
FIRSTPART=$(echo $VERSION|rev|cut -d . -f 2- |rev)
VERSION=${FIRSTPART}.${LASTNUM}
VERSION=$VERSION~dev$NUMCOMMITS+`git describe|cut -d- -f 3`
fi
echo $VERSION > VERSION
sed -e "s/#VERSION#/$VERSION/" setup.py.tmpl > setup.py