File: makesetup

package info (click to toggle)
python-pyghmi 1.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,376 kB
  • sloc: python: 21,736; sh: 35; makefile: 18
file content (14 lines) | stat: -rwxr-xr-x 460 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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