summaryrefslogtreecommitdiff
path: root/debian/freeze_python_version.sh
blob: ded3106b181ecc01a6f5acfb50ecf3945e0e2925 (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