From 362e79b3bc5a21793648d9a1ee81406e7d0d291a Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Wed, 20 Jun 2018 13:47:03 +0500 Subject: [PATCH] compare debian/changelog and src/CurrentBuild.txt --- .ci/check-debian-package-version.sh | 30 +++++++++++++++++++++++++++++ .travis.yml | 6 ++++++ 2 files changed, 36 insertions(+) create mode 100755 .ci/check-debian-package-version.sh diff --git a/.ci/check-debian-package-version.sh b/.ci/check-debian-package-version.sh new file mode 100755 index 00000000..1b38380e --- /dev/null +++ b/.ci/check-debian-package-version.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +while IFS=$'\n\r' read -r line || [[ -n "$line" ]]; do + echo "Text read from file: $line" + case $line in + BUILD_NUMBER\ *) + BUILD_NUMBER=${line#BUILD_NUMBER } + ;; + VERSION\ *) + VERSION=${line#VERSION } + ;; + BUILD_NAME\ *) + BUILD_NAME=${line#BUILD_NAME } + ;; + + esac +done < "src/CurrentBuild.txt" + +VERSION=${VERSION:0:1}.${VERSION:1} # Add a colon after the first character. ("501" => "5.01") + +CHANGELOG_VERSION="(0:$VERSION.$BUILD_NUMBER) $BUILD_NAME" + +IFS=$'\n\r' read -r line < "debian/changelog" +if [[ $line == *$CNANGELOG_VERSION* ]]; then + echo "debian/changelog matches src/CurrentBuild.txt" +else + echo "debian/changelog does not match src/CurrentBuild.txt" + exit 1 +fi diff --git a/.travis.yml b/.travis.yml index 5bacdfb2..4c3cc9fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,12 @@ matrix: - env: OPENSSL_VERSION="1.1.0f" os: linux compiler: clang + - env: DESCRIPTION="check debian package version" + os: linux + before_install: + - true + script: + - .ci/check-debian-package-version.sh - os: osx compiler: clang before_install: