summaryrefslogtreecommitdiff
path: root/debian/freeze_python_version.sh
blob: dcdffabc08a7a1cb18cc4ad4b49a70356d6ac55c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

VERSION_FILE="src/leap/mx/_version.py"
rm ${VERSION_FILE}
echo y | python setup.py freeze_debianver

# Add the number of commits after last tag to the version string
add_commits=$(git describe | cut -d'-' -f2)
rev=$(git describe | cut -d'-' -f3)
sed -i "/ \"version/s/\"$/.${add_commits}.${rev}\"/" ${VERSION_FILE}

# Remove the -dirty tag
sed -i 's/-dirty//g' ${VERSION_FILE}

git commit -m "[pkg] freeze debian version" ${VERSION_FILE}

python setup.py version