diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-08-07 23:39:32 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-08-08 12:06:49 +0200 |
commit | 6d57556c97d25a6df7e688dd82564f59a0decd85 (patch) | |
tree | 64a5ae43f51b7ba860636714eee4269428f5916f | |
parent | c4228d11ff5df065ffce58a0df1e59c32ba593dd (diff) |
osmo-release.sh: Verify consistency of dependency versions in configure.ac and debian/control
Sample output for current osmo-msc master:
Releasing 1.3.1.191-7ea0d -> 1.4.0...
ERROR: configure.ac <libosmocore, 1.0.0> does NOT match debian/control <libosmocore, 0.10.0>!
ERROR: configure.ac <libosmo-netif, 0.4.0> does NOT match debian/control <libosmo-netif, 0.1.0>!
ERROR: configure.ac <libosmo-sigtran, 1.0.0> does NOT match debian/control <libosmo-sigtran, 0.8.0>!
ERROR: configure.ac <libosmo-mgcp-client, 1.5.0> does NOT match debian/control <libosmo-mgcp-client, 1.1.0>!
ERROR: configure.ac <libosmo-gsup-client, 1.0.0> does NOT match debian/control <libosmo-gsup-client, 0.2.1>!
ERROR: configure.ac <libsmpp34, 1.13.0> does NOT match debian/control <libsmpp34, 1.12>!
ERROR: configure.ac <libasn1c, 0.9.30> does NOT match debian/control <libasn1c, 0.9.28>!
ERROR: configure.ac <libosmo-ranap, 0.3.0> does NOT match debian/control <libosmo-ranap, 0.2.0>!
ERROR: exiting due to previous errors
make: *** [osmo-release.mk:9: release] Error 1
Change-Id: I702a82c1b0e21dbe71a334a6f8bc62efe07859a6
-rwxr-xr-x | osmo-release.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/osmo-release.sh b/osmo-release.sh index e9602aa1..38f238df 100755 --- a/osmo-release.sh +++ b/osmo-release.sh @@ -21,6 +21,46 @@ libversion_to_deb_major() { echo "$major" } +# Make sure that depedency requirement versions match in configure.ac vs debian/control. +#eg: "PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.1.0)" vs "libosmocore-dev (>= 1.0.0)," +check_configureac_debctrl_deps_match() { + configureac_list=$(grep -e "PKG_CHECK_MODULES" "${GIT_TOPDIR}/configure.ac" | cut -d "," -f 2 | tr -d ")" | tr -d " " | sed "s/>=/ /g") + echo "$configureac_list" | \ + { return_error=0 + while read -r dep ver; do + + debctrl_match="$(grep -e "${dep}-dev" ${GIT_TOPDIR}/debian/control | grep ">=")" + debctrl_match_count="$(echo "$debctrl_match" | grep -c ">=")" + if [ "z$debctrl_match_count" != "z0" ]; then + #echo "Dependency <$dep, $ver> from configure.ac matched in debian/control! ($debctrl_match_count)" + if [ "z$debctrl_match_count" != "z1" ]; then + echo "WARN: configure.ac <$dep, $ver> matches debian/control $debctrl_match_count times, manual check required!" + else # 1 match: + parsed_match=$(echo "$debctrl_match" | tr -d "(" | tr -d ")" | tr -d "," | tr -d " " | sed "s/>=/ /g") + debctrl_dep=$(echo "$parsed_match" | cut -d " " -f 1 | sed "s/-dev//g") + debctrl_ver=$(echo "$parsed_match" | cut -d " " -f 2) + if [ "z$dep" != "z$debctrl_dep" ] || [ "z$ver" != "z$debctrl_ver" ]; then + echo "ERROR: configure.ac <$dep, $ver> does NOT match debian/control <$debctrl_dep, $debctrl_ver>!" + return_error=1 + #else + # echo "OK: configure.ac <$dep, $ver> matches debian/control <$debctrl_dep, $debctrl_ver>" + fi + fi + fi + done + if [ $return_error -ne 0 ]; then + exit 1 + fi + } + + # catch and forward exit from pipe subshell "while read": + if [ $? -ne 0 ]; then + echo "ERROR: exiting due to previous errors" + exit 1 + fi + echo "OK: dependency specific versions in configure.ac and debian/control match" +} + BUMPVER=`command -v bumpversion` GIT_TOPDIR="$(git rev-parse --show-toplevel)" NEW_VER=`bumpversion --list --current-version $VERSION $REL --allow-dirty | awk -F '=' '{ print $2 }'` @@ -40,6 +80,8 @@ fi echo "Releasing $VERSION -> $NEW_VER..." +check_configureac_debctrl_deps_match + if [ "z$LIBVERS" != "z" ]; then if [ "z$MAKEMOD" = "z" ] && [ "z$ALLOW_NO_LIBVERSION_CHANGE" = "z0" ]; then echo "ERROR: Before releasing, please modify some of the libversions: $LIBVERS" |