2017-10-03 08:54:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
VERSION=$1
|
|
|
|
REL=$2
|
|
|
|
|
|
|
|
if [ "z$REL" = "z" ]; then
|
2024-07-23 10:05:49 +00:00
|
|
|
echo "usage: make REL=patch|minor|major release"
|
|
|
|
echo
|
|
|
|
echo "optional environment variables:"
|
|
|
|
echo " DRY_RUN=1 run checks but make no modifications"
|
|
|
|
echo " ALLOW_NO_LIBVERSION_CHANGE=1 skip LIBVERSION in Makefile.am fchecks"
|
|
|
|
echo " ALLOW_NO_LIBVERSION_DEB_MATCH=1 skip LIBVERSION in debian packaging checks"
|
|
|
|
echo " ALLOW_NO_LIBVERSION_RPM_MATCH=1 skip LIBVERSION in rpm packaging checks"
|
|
|
|
echo
|
|
|
|
echo "See also:"
|
|
|
|
echo "https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release"
|
|
|
|
exit 1
|
2017-10-03 08:54:41 +00:00
|
|
|
fi
|
|
|
|
|
2018-08-30 10:56:53 +00:00
|
|
|
ALLOW_NO_LIBVERSION_CHANGE="${ALLOW_NO_LIBVERSION_CHANGE:-0}"
|
2018-08-30 11:50:33 +00:00
|
|
|
ALLOW_NO_LIBVERSION_DEB_MATCH="${ALLOW_NO_LIBVERSION_DEB_MATCH:-0}"
|
2021-02-24 12:22:44 +00:00
|
|
|
ALLOW_NO_LIBVERSION_RPM_MATCH="${ALLOW_NO_LIBVERSION_RPM_MATCH:-0}"
|
2019-08-07 12:40:08 +00:00
|
|
|
# Test stuff but don't modify stuff:
|
|
|
|
DRY_RUN="${DRY_RUN:-0}"
|
2018-08-30 10:56:53 +00:00
|
|
|
|
2024-07-23 12:17:10 +00:00
|
|
|
RESET="\033[1;0m"
|
|
|
|
RED="\033[1;31m"
|
|
|
|
GREEN="\033[1;32m"
|
|
|
|
YELLOW="\033[1;33m"
|
|
|
|
|
|
|
|
ok() {
|
|
|
|
echo "${GREEN}OK:${RESET} $@"
|
|
|
|
}
|
|
|
|
|
|
|
|
warn() {
|
|
|
|
echo "${YELLOW}WARN:${RESET} $@"
|
|
|
|
}
|
|
|
|
|
|
|
|
error() {
|
|
|
|
echo "${RED}ERROR:${RESET} $@"
|
|
|
|
}
|
|
|
|
|
2021-02-24 12:22:44 +00:00
|
|
|
libversion_to_lib_major() {
|
2018-08-30 11:50:33 +00:00
|
|
|
libversion="$1"
|
|
|
|
current="$(echo "$libversion" | cut -d ":" -f 1)"
|
|
|
|
#revision="$(echo "$libversion" | cut -d ":" -f 2)"
|
|
|
|
age="$(echo "$libversion" | cut -d ":" -f 3)"
|
|
|
|
major="$(expr "$current" - "$age")"
|
|
|
|
echo "$major"
|
|
|
|
}
|
2017-10-03 08:54:41 +00:00
|
|
|
|
2021-02-24 11:50:03 +00:00
|
|
|
get_configureac_pkg_check_modules_list() {
|
2019-08-08 15:37:16 +00:00
|
|
|
if [ -f "${GIT_TOPDIR}/openbsc/configure.ac" ]; then
|
|
|
|
configureac_file="openbsc/configure.ac"
|
|
|
|
else
|
|
|
|
configureac_file="configure.ac"
|
|
|
|
fi
|
2021-02-24 11:50:03 +00:00
|
|
|
grep -e "PKG_CHECK_MODULES(" "${GIT_TOPDIR}/${configureac_file}" | cut -d "," -f 2 | tr -d ")" | tr -d "[" | tr -d "]" | tr -d " " | sed "s/>=/ /g"
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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() {
|
|
|
|
get_configureac_pkg_check_modules_list | \
|
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
2019-08-07 21:39:32 +00:00
|
|
|
{ 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
|
2024-07-23 12:17:10 +00:00
|
|
|
warn "configure.ac <$dep, $ver> matches debian/control $debctrl_match_count times, manual check required!"
|
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
2019-08-07 21:39:32 +00:00
|
|
|
else # 1 match:
|
2021-02-23 12:20:15 +00:00
|
|
|
parsed_match=$(echo "$debctrl_match" | tr -d "(" | tr -d ")" | tr -d "," | tr -d " " | tr -d "\t" | sed "s/>=/ /g")
|
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
2019-08-07 21:39:32 +00:00
|
|
|
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
|
2024-07-23 12:17:10 +00:00
|
|
|
error "configure.ac <$dep, $ver> does NOT match debian/control <$debctrl_dep, $debctrl_ver>!"
|
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
2019-08-07 21:39:32 +00:00
|
|
|
return_error=1
|
|
|
|
#else
|
2024-07-23 12:17:10 +00:00
|
|
|
# ok "configure.ac <$dep, $ver> matches debian/control <$debctrl_dep, $debctrl_ver>"
|
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
2019-08-07 21:39:32 +00:00
|
|
|
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
|
2024-07-23 12:17:10 +00:00
|
|
|
error "exiting due to previous errors"
|
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
2019-08-07 21:39:32 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2024-07-23 12:17:10 +00:00
|
|
|
ok "dependency specific versions in configure.ac and debian/control match"
|
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
2019-08-07 21:39:32 +00:00
|
|
|
}
|
|
|
|
|
2021-02-24 11:50:03 +00:00
|
|
|
# Make sure that depedency requirement versions match in configure.ac vs contrib/*.spec.in.
|
|
|
|
#eg: "PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.1.0)" vs "pkgconfig(libosmocore-dev) >= 1.0.0,"
|
|
|
|
check_configureac_rpmspecin_deps_match() {
|
2021-03-26 12:50:08 +00:00
|
|
|
# Some projects don't have rpm spec files:
|
|
|
|
if [ "z$(find "${GIT_TOPDIR}/contrib" -name "*.spec.in" | wc -l)" = "z0" ]; then
|
|
|
|
echo "INFO: Project has no 'contrib/*.spec.in' files, skipping RPM specific configure.ac dependency version checks"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2021-02-24 11:50:03 +00:00
|
|
|
get_configureac_pkg_check_modules_list | \
|
|
|
|
{ return_error=0
|
|
|
|
while read -r dep ver; do
|
|
|
|
|
|
|
|
rpmspecin_match="$(grep -e "pkgconfig(${dep})" ${GIT_TOPDIR}/contrib/*.spec.in | grep BuildRequires | grep pkgconfig | grep ">=")"
|
|
|
|
rpmspecin_match_count="$(echo "$rpmspecin_match" | grep -c ">=")"
|
|
|
|
if [ "z$rpmspecin_match_count" != "z0" ]; then
|
|
|
|
#echo "Dependency <$dep, $ver> from configure.ac matched in contrib/*.spec.in! ($rpmspecin_match_count)"
|
|
|
|
if [ "z$rpmspecin_match_count" != "z1" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
warn "configure.ac <$dep, $ver> matches contrib/*.spec.in $rpmspecin_match_count times, manual check required!"
|
2021-02-24 11:50:03 +00:00
|
|
|
else # 1 match:
|
|
|
|
parsed_match=$(echo "$rpmspecin_match" | tr -d "(" | tr -d ")" | tr -d ":" | tr -d " " | tr -d "\t" | sed "s/BuildRequires//g" | sed "s/pkgconfig//g" |sed "s/>=/ /g")
|
|
|
|
rpmspecin_dep=$(echo "$parsed_match" | cut -d " " -f 1)
|
|
|
|
rpmspecin_ver=$(echo "$parsed_match" | cut -d " " -f 2)
|
|
|
|
if [ "z$dep" != "z$rpmspecin_dep" ] || [ "z$ver" != "z$rpmspecin_ver" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
error "configure.ac <$dep, $ver> does NOT match contrib/*.spec.in <$rpmspecin_dep, $rpmspecin_ver>!"
|
2021-02-24 11:50:03 +00:00
|
|
|
return_error=1
|
|
|
|
#else
|
2024-07-23 12:17:10 +00:00
|
|
|
# ok "configure.ac <$dep, $ver> matches contrib/*.spec.in <$debctrl_dep, $debctrl_ver>"
|
2021-02-24 11:50:03 +00:00
|
|
|
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
|
2024-07-23 12:17:10 +00:00
|
|
|
error "exiting due to previous errors"
|
2021-02-24 11:50:03 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2024-07-23 12:17:10 +00:00
|
|
|
ok "dependency specific versions in configure.ac and contrib/*.spec.in match"
|
2021-02-24 11:50:03 +00:00
|
|
|
}
|
|
|
|
|
2019-08-08 10:59:40 +00:00
|
|
|
# Make sure that patches under debian/patches/ apply:
|
|
|
|
check_debian_patch_apply() {
|
|
|
|
if [ ! -d "${GIT_TOPDIR}/debian/patches" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
for patch in ${GIT_TOPDIR}/debian/patches/*.patch; do
|
|
|
|
git apply --check $patch
|
|
|
|
if [ $? -ne 0 ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
error "patch no longer applies! $patch"
|
2019-08-08 10:59:40 +00:00
|
|
|
exit 1
|
|
|
|
else
|
2024-07-23 12:17:10 +00:00
|
|
|
ok "patch applies: $patch"
|
2019-08-08 10:59:40 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-02-24 12:22:44 +00:00
|
|
|
libversion_deb_match() {
|
|
|
|
echo "$LIBVERS" | while read -r line; do
|
|
|
|
libversion=$(echo "$line" | cut -d "=" -f 2 | tr -d "[:space:]")
|
|
|
|
major="$(libversion_to_lib_major "$libversion")"
|
|
|
|
file_matches="$(find "${GIT_TOPDIR}/debian" -name "lib*${major}.install" | wc -l)"
|
|
|
|
if [ "z$file_matches" = "z0" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
error "Found no matching debian/lib*$major.install file for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
exit 1
|
|
|
|
elif [ "z$file_matches" = "z1" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
ok "Found matching debian/lib*$major.install for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
else
|
2024-07-23 12:17:10 +00:00
|
|
|
warn "Found $file_matches files matching debian/lib*$major.install for LIBVERSION=$libversion, manual check required!"
|
2021-02-24 12:22:44 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
control_matches="$(grep -e "Package" "${GIT_TOPDIR}/debian/control" | grep "lib" | grep "$major$" | wc -l)"
|
|
|
|
if [ "z$control_matches" = "z0" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
error "Found no matching Package lib*$major in debian/control for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
exit 1
|
|
|
|
elif [ "z$control_matches" = "z1" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
ok "Found 'Package: lib*$major' in debian/control for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
else
|
2024-07-23 12:17:10 +00:00
|
|
|
warn "Found $file_matches files matching 'Package: lib*$major' in debian/control for LIBVERSION=$libversion, manual check required!"
|
2021-02-24 12:22:44 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
dhstrip_lib_total="$(grep -e "dh_strip" "${GIT_TOPDIR}/debian/rules" | grep "\-plib" | wc -l)"
|
|
|
|
dhstrip_lib_matches="$(grep -e "dh_strip" "${GIT_TOPDIR}/debian/rules" | grep "\-plib" | grep "$major" | wc -l)"
|
|
|
|
if [ "z$dhstrip_lib_total" != "z0" ]; then
|
|
|
|
if [ "z$dhstrip_lib_matches" = "z0" ] ; then
|
2024-07-23 12:17:10 +00:00
|
|
|
error "Found no matching 'dh_strip -plib*$major' line in debian/rules for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
exit 1
|
|
|
|
elif [ "z$dhstrip_lib_total" = "z1" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
ok "Found 'dh_strip -plib*$major' in debian/rules for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
else
|
2024-07-23 12:17:10 +00:00
|
|
|
warn "Found $dhstrip_lib_matches/$dhstrip_lib_total dh_strip matches 'dh_strip -plib*$major' in debian/rules for LIBVERSION=$libversion, manual check required!"
|
2021-02-24 12:22:44 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
# catch and forward exit from pipe subshell "while read":
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
libversion_rpmspecin_match() {
|
2021-03-26 12:50:08 +00:00
|
|
|
# Some projects don't have rpm spec files:
|
|
|
|
if [ "z$(find "${GIT_TOPDIR}/contrib" -name "*.spec.in" | wc -l)" = "z0" ]; then
|
|
|
|
echo "INFO: Project has no 'contrib/*.spec.in' files, skipping RPM specific LIBVERSION checks"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2021-02-24 12:22:44 +00:00
|
|
|
echo "$LIBVERS" | while read -r line; do
|
|
|
|
libversion=$(echo "$line" | cut -d "=" -f 2 | tr -d "[:space:]")
|
|
|
|
major="$(libversion_to_lib_major "$libversion")"
|
|
|
|
|
|
|
|
control_matches="$(grep -e "%files" "${GIT_TOPDIR}/contrib/"*.spec.in | grep "lib" | grep "$major$" | wc -l)"
|
|
|
|
if [ "z$control_matches" = "z0" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
error "Found no matching '%files -n lib*$major' in contrib/*.spec.in for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
exit 1
|
|
|
|
elif [ "z$control_matches" = "z1" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
ok "Found '%files -n lib*$major' in contrib/*.spec.in for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
else
|
2024-07-23 12:17:10 +00:00
|
|
|
warn "Found $file_matches files matching '%files -n lib*$major' in contrib/*.spec.in for LIBVERSION=$libversion, manual check required!"
|
2021-02-24 12:22:44 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
control_matches="$(grep -e "_libdir" "${GIT_TOPDIR}/contrib/"*.spec.in | grep "/lib" | grep "so.$major" | wc -l)"
|
|
|
|
if [ "z$control_matches" = "z0" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
error "Found no matching '%_libdir/lib*.so.$major*' in contrib/*.spec.in for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
exit 1
|
|
|
|
elif [ "z$control_matches" = "z1" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
ok "Found '%_libdir/lib*.so.$major*' in contrib/*.spec.in for LIBVERSION=$libversion"
|
2021-02-24 12:22:44 +00:00
|
|
|
else
|
2024-07-23 12:17:10 +00:00
|
|
|
warn "Found $file_matches files matching '%_libdir/lib*.so.$major*' in contrib/*.spec.in for LIBVERSION=$libversion, manual check required!"
|
2021-02-24 12:22:44 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
# catch and forward exit from pipe subshell "while read":
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-07-23 14:02:49 +00:00
|
|
|
clean_todo_release() {
|
|
|
|
rm -f TODO-RELEASE
|
|
|
|
echo "# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install" >> TODO-RELEASE
|
|
|
|
echo "# according to https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release" >> TODO-RELEASE
|
|
|
|
echo "# In short: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" >> TODO-RELEASE
|
|
|
|
echo "# LIBVERSION=c:r:a" >> TODO-RELEASE
|
|
|
|
echo "# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a." >> TODO-RELEASE
|
2024-07-23 14:06:30 +00:00
|
|
|
echo "# If any interfaces have been added, removed, or changed since the last update: c + 1:0:a." >> TODO-RELEASE
|
2024-07-23 14:02:49 +00:00
|
|
|
echo "# If any interfaces have been added since the last public release: c:r:a + 1." >> TODO-RELEASE
|
|
|
|
echo "# If any interfaces have been removed or changed since the last public release: c:r:0." >> TODO-RELEASE
|
|
|
|
echo "#library what description / commit summary line" >> TODO-RELEASE
|
|
|
|
git add TODO-RELEASE
|
|
|
|
}
|
|
|
|
|
2021-02-24 12:22:44 +00:00
|
|
|
|
2018-08-30 11:50:33 +00:00
|
|
|
BUMPVER=`command -v bumpversion`
|
2017-10-03 08:54:41 +00:00
|
|
|
if [ "z$BUMPVER" = "z" ]; then
|
|
|
|
echo Unable to find 'bumpversion' command.
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-02-24 15:44:48 +00:00
|
|
|
NEW_VER=`$BUMPVER --list --current-version $VERSION $REL --allow-dirty | awk -F '=' '{ print $2 }'`
|
2017-10-03 08:54:41 +00:00
|
|
|
if [ "z$NEW_VER" = "z" ]; then
|
|
|
|
echo "Please fix versioning to match http://semver.org/ spec (current is $VERSION) before proceeding."
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-02-24 15:44:48 +00:00
|
|
|
GIT_TOPDIR="$(git rev-parse --show-toplevel)"
|
2021-11-16 12:02:28 +00:00
|
|
|
LIBVERS=`git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS | grep -v osmo-release.sh`
|
2021-02-24 15:44:48 +00:00
|
|
|
MAKEMOD=`git diff --cached -GLIBVERSION --stat | grep Makefile.am`
|
|
|
|
ISODATE=`date -I`
|
2017-10-03 08:54:41 +00:00
|
|
|
|
|
|
|
echo "Releasing $VERSION -> $NEW_VER..."
|
|
|
|
|
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
2019-08-07 21:39:32 +00:00
|
|
|
check_configureac_debctrl_deps_match
|
2021-02-24 11:50:03 +00:00
|
|
|
check_configureac_rpmspecin_deps_match
|
2019-08-08 10:59:40 +00:00
|
|
|
check_debian_patch_apply
|
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
2019-08-07 21:39:32 +00:00
|
|
|
|
osmo-release.sh: Always generate entire commit changelog
Before this commit, for library projects (containing LIBVERSION in some
Makefile), the entire commit list was not stored into the changelog, but
only a few lines from TODO-RELEASE files.
This is a bad approach for several reasons. First, because that file was
only aimed at containing API/ABI breaks, and not the full relevant
changeset (like bugfixes, new features, etc.). Second, because it relies
on every developer making API/ABI changes to remember to store the
change in there during commit break time.
Let's instead always store the entire commit list in changelog, and
let's use TODO-RELEASE only as a list of hints for the maintainer to
help him evaluate how LIBVERSION needs to be bumped for each library.
Other tools such as osmo-abi-check.git can be used to help with the
process of decission too.
Let's take the opportunity too to only commit stuff already added to the
staging area, as it proved easier to manage from my personal experinece
making latest releases.
Change-Id: Ibf662173ce2b4ff3966e9ad5f56c65dfb13607ff
2018-05-03 13:01:47 +00:00
|
|
|
if [ "z$LIBVERS" != "z" ]; then
|
2018-08-30 10:56:53 +00:00
|
|
|
if [ "z$MAKEMOD" = "z" ] && [ "z$ALLOW_NO_LIBVERSION_CHANGE" = "z0" ]; then
|
2024-07-23 12:17:10 +00:00
|
|
|
error "Before releasing, please modify some of the libversions:"
|
2024-01-28 11:01:47 +00:00
|
|
|
for l in $LIBVERS; do echo " $l"; done
|
|
|
|
echo "After making changes, add modified file(s) to the index using git-add."
|
osmo-release.sh: Always generate entire commit changelog
Before this commit, for library projects (containing LIBVERSION in some
Makefile), the entire commit list was not stored into the changelog, but
only a few lines from TODO-RELEASE files.
This is a bad approach for several reasons. First, because that file was
only aimed at containing API/ABI breaks, and not the full relevant
changeset (like bugfixes, new features, etc.). Second, because it relies
on every developer making API/ABI changes to remember to store the
change in there during commit break time.
Let's instead always store the entire commit list in changelog, and
let's use TODO-RELEASE only as a list of hints for the maintainer to
help him evaluate how LIBVERSION needs to be bumped for each library.
Other tools such as osmo-abi-check.git can be used to help with the
process of decission too.
Let's take the opportunity too to only commit stuff already added to the
staging area, as it proved easier to manage from my personal experinece
making latest releases.
Change-Id: Ibf662173ce2b4ff3966e9ad5f56c65dfb13607ff
2018-05-03 13:01:47 +00:00
|
|
|
echo "You should NOT be doing this unless you've read and understood following article:"
|
|
|
|
echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info"
|
2018-05-02 13:58:37 +00:00
|
|
|
exit 1
|
2017-10-03 08:54:41 +00:00
|
|
|
fi
|
2018-08-30 11:50:33 +00:00
|
|
|
if [ "z$ALLOW_NO_LIBVERSION_DEB_MATCH" = "z0" ]; then
|
2021-02-24 12:22:44 +00:00
|
|
|
libversion_deb_match
|
|
|
|
fi
|
|
|
|
if [ "z$ALLOW_NO_LIBVERSION_RPM_MATCH" = "z0" ]; then
|
|
|
|
libversion_rpmspecin_match
|
2018-08-30 11:50:33 +00:00
|
|
|
fi
|
2017-10-03 08:54:41 +00:00
|
|
|
fi
|
2019-08-07 12:40:08 +00:00
|
|
|
|
|
|
|
if [ "z$DRY_RUN" != "z0" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
2019-09-19 14:03:42 +00:00
|
|
|
|
2019-12-03 16:35:02 +00:00
|
|
|
set -e
|
2024-07-23 14:02:49 +00:00
|
|
|
|
2019-09-19 14:03:42 +00:00
|
|
|
if [ -f "TODO-RELEASE" ]; then
|
2024-07-23 14:02:49 +00:00
|
|
|
clean_todo_release
|
2019-09-19 14:03:42 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-26 07:38:20 +00:00
|
|
|
# Add missing epoch (OS#5046)
|
|
|
|
DEB_VER=$(head -1 debian/changelog | cut -d ' ' -f 2 | sed 's,(,,' | sed 's,),,')
|
|
|
|
NEW_VER_WITH_EPOCH="$NEW_VER"
|
|
|
|
case "$DEB_VER" in
|
|
|
|
*:*)
|
|
|
|
epoch="$(echo "$DEB_VER" | cut -d: -f1)"
|
|
|
|
NEW_VER_WITH_EPOCH="$epoch:$NEW_VER"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
gbp dch \
|
|
|
|
--debian-tag='%(version)s' \
|
|
|
|
--auto \
|
|
|
|
--meta \
|
|
|
|
--git-author \
|
|
|
|
--multimaint-merge \
|
|
|
|
--ignore-branch \
|
|
|
|
--new-version="$NEW_VER_WITH_EPOCH"
|
2017-10-03 08:54:41 +00:00
|
|
|
dch -r -m --distribution "unstable" ""
|
2019-08-08 15:37:16 +00:00
|
|
|
git add ${GIT_TOPDIR}/debian/changelog
|
2022-01-05 10:55:15 +00:00
|
|
|
$BUMPVER --current-version $VERSION $REL --tag --commit --tag-name $NEW_VER --allow-dirty
|
2018-05-03 13:25:11 +00:00
|
|
|
git commit --amend # let the user add extra information to the release commit.
|
2017-10-03 08:54:41 +00:00
|
|
|
git tag -s $NEW_VER -f -m "Release v$NEW_VER on $ISODATE."
|
|
|
|
echo "Release $NEW_VER prepared, tagged and signed."
|