3
3
# Check that all files that should have the current version agree on it
5
# The configure.ac is hand-edited, assume it must be sane
6
7
AC_VERS=$(sed '/AC_INIT/!d; s/AC_INIT(libiphb, \(.*\))/\1/' $AC_PATH)
8
RPM_PATH=${RPM_SOURCE_DIR:-rpm}/${RPM_PACKAGE_NAME:-libiphb}.spec
9
RPM_VERS=$(grep '^Version:' $RPM_PATH |sed -e 's/^.*:[[:space:]]*//')
11
# The .spec is either in rpm subdir or where ever rpmbuild got it from
12
SPEC_PATH=${RPM_SOURCE_DIR:-rpm}/${RPM_PACKAGE_NAME:-libiphb}.spec
13
SPEC_VERS=$(grep '^Version:' $SPEC_PATH |sed -e 's/^.*:[[:space:]]*//')
15
if [ "$SPEC_VERS" != "$AC_VERS" ]; then
16
echo >&2 "$AC_PATH=$AC_VERS vs $SPEC_PATH=$SPEC_VERS"
18
# When building untagged commits via obs the spec will have as
19
# a version something like "<previous_tag>+<branch>.<hash>".
20
# Accept those, if version matches up to the first '+'.
21
if [ "${SPEC_VERS%%+*}" = "$AC_VERS" ]; then
22
echo >&2 " (ignored - assuming $AC_VERS + work in progress)"
28
# The yaml file is included in the git tree, but might not be available
29
# when making package build via OBS ...
11
30
YAML_PATH=${RPM_SOURCE_DIR:-rpm}/${RPM_PACKAGE_NAME:-libiphb}.yaml
12
YAML_VERS=$(grep '^Version:' $YAML_PATH |sed -e 's/^.*:[[:space:]]*//')
16
if [ "$RPM_VERS" != "$AC_VERS" ]; then
17
echo >&2 "$AC_PATH $AC_VERS vs $RPM_PATH $RPM_VERS"
21
if [ "$RPM_VERS" != "$YAML_VERS" ]; then
22
echo >&2 "$YAML_PATH $YAML_VERS vs $RPM_PATH $RPM_VERS"
32
if [ -f $YAML_PATH ]; then
33
YAML_VERS=$(grep '^Version:' $YAML_PATH |sed -e 's/^.*:[[:space:]]*//')
34
if [ "$YAML_VERS" != "$AC_VERS" ]; then
35
echo >&2 "$AC_PATH=$AC_VERS vs $YAML_PATH=$YAML_VERS"
26
40
if [ $RES != 0 ]; then
27
41
echo >&2 "Conflicting package versions"
44
# Stop the rpm-build ifthere were conflicts