Change in libosmocore[master]: osmo-release.sh: Check configure.ac dependency versions match those i...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Wed Feb 24 11:50:12 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/23088 )


Change subject: osmo-release.sh: Check configure.ac dependency versions match those in rpm *.spec.in
......................................................................

osmo-release.sh: Check configure.ac dependency versions match those in rpm *.spec.in

Change-Id: I694f4055b39f91aaa0cf5997af67feefad99fdf5
---
M osmo-release.sh
1 file changed, 48 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/23088/1

diff --git a/osmo-release.sh b/osmo-release.sh
index b63f981..52ccfeb 100755
--- a/osmo-release.sh
+++ b/osmo-release.sh
@@ -21,16 +21,19 @@
 	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() {
+get_configureac_pkg_check_modules_list() {
 	if [ -f "${GIT_TOPDIR}/openbsc/configure.ac" ]; then
 		configureac_file="openbsc/configure.ac"
 	else
 		configureac_file="configure.ac"
 	fi
-	configureac_list=$(grep -e "PKG_CHECK_MODULES(" "${GIT_TOPDIR}/${configureac_file}" | cut -d "," -f 2 | tr -d ")" | tr -d "[" | tr -d "]" | tr -d " " | sed "s/>=/ /g")
-	echo "$configureac_list" | \
+	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 | \
 	{ return_error=0
 	while read -r dep ver; do
 
@@ -66,6 +69,45 @@
 	echo "OK: dependency specific versions in configure.ac and debian/control match"
 }
 
+# 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() {
+	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
+				echo "WARN: configure.ac <$dep, $ver> matches contrib/*.spec.in $rpmspecin_match_count times, manual check required!"
+			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
+					echo "ERROR: configure.ac <$dep, $ver> does NOT match contrib/*.spec.in <$rpmspecin_dep, $rpmspecin_ver>!"
+					return_error=1
+				#else
+				#	echo "OK: configure.ac <$dep, $ver> matches contrib/*.spec.in <$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 contrib/*.spec.in match"
+}
+
 # Make sure that patches under debian/patches/ apply:
 check_debian_patch_apply() {
 	if [ ! -d "${GIT_TOPDIR}/debian/patches" ]; then
@@ -102,6 +144,7 @@
 echo "Releasing $VERSION -> $NEW_VER..."
 
 check_configureac_debctrl_deps_match
+check_configureac_rpmspecin_deps_match
 check_debian_patch_apply
 
 if [ "z$LIBVERS" != "z" ]; then

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/23088
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I694f4055b39f91aaa0cf5997af67feefad99fdf5
Gerrit-Change-Number: 23088
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210224/93ff64c0/attachment.htm>


More information about the gerrit-log mailing list