summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml1
-rwxr-xr-xdebian/freeze_python_version.sh16
2 files changed, 17 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 704f7a7..d153180 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -36,6 +36,7 @@ package:amd64:jessie:
ARCH: "amd64"
DIST: "jessie"
REPOS: "jessie"
+ PRE_COMMIT_CMD="./debian/freeze_python_version.sh"
<<: *job_definition
lintian:
diff --git a/debian/freeze_python_version.sh b/debian/freeze_python_version.sh
new file mode 100755
index 0000000..65a9bac
--- /dev/null
+++ b/debian/freeze_python_version.sh
@@ -0,0 +1,16 @@
+#!/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)
+sed -i "/ \"version/s/\"$/-${add_commits}\"/" ${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