File: check_versions

package info (click to toggle)
libwibble 1.1-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 1,088 kB
  • ctags: 2,743
  • sloc: cpp: 14,551; makefile: 191; perl: 87; sh: 26
file content (24 lines) | stat: -rw-r--r-- 739 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

DEB_VERSION=$(head -1 debian/changelog | sed -re 's/[^(]+\(([^)]+)\).+/\1/')
DEB_UPSTREAM_VERSION=$(echo $DEB_VERSION | sed -r 's/-.+//')
AUTOTOOLS_VERSION=$(grep ^AC_INIT configure.ac | sed -r 's/[^[]+\[([^]]+)\].+/\1/')
CMAKE_VERSION=$(grep '^set( *VERSION' CMakeLists.txt |sed -r 's/.+"([^"]+)".+/\1/')

if [ $CMAKE_VERSION != $AUTOTOOLS_VERSION ]
then
	echo "Version mismatch between CMakeLists.txt ($CMAKE_VERSION) and configure.ac ($AUTOTOOLS_VERSION)"
	exit 1
fi

if [ $DEB_UPSTREAM_VERSION != $AUTOTOOLS_VERSION ]
then
	echo "Version mismatch between debian/changelog ($DEB_UPSTREAM_VERSION) and configure.ac ($AUTOTOOLS_VERSION)" >&2
	exit 1
fi

#echo $DEB_VERSION
#echo $CMAKE_VERSION
#echo $AUTOTOOLS_VERSION

exit 0