[PATCH] osmo-ci[master]: coverity: Reduce codeduplication in build_Osmocom.sh

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Oct 11 00:46:40 UTC 2017


Review at  https://gerrit.osmocom.org/4207

coverity: Reduce codeduplication in build_Osmocom.sh

We don't need a separate build_foo function if it is identical in
its body except for the 'foo' (project name).  Let's clean this up.

Change-Id: I27e9fc94142b42a7b7c2f9eca89056e1f90f1f0e
---
M coverity/build_Osmocom.sh
1 file changed, 18 insertions(+), 94 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/07/4207/1

diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh
index bccd7ea..910f810 100755
--- a/coverity/build_Osmocom.sh
+++ b/coverity/build_Osmocom.sh
@@ -22,16 +22,16 @@
 	make install
 }
 
+build_default() {
+	pushd $1
+	do_build
+	popd
+}
+
 build_layer1api() {
 	pushd layer1-api
 	install -d "$prefix/include/sysmocom/femtobts/"
 	cp include/*.h "$prefix/include/sysmocom/femtobts/"
-	popd
-}
-
-build_asn1c() {
-	pushd asn1c
-	do_build
 	popd
 }
 
@@ -42,50 +42,11 @@
 	popd
 }
 
-build_osmoiuh() {
-	pushd osmo-iuh
-	do_build
-	popd
-}
-
-build_libosmocore() {
-	pushd libosmocore
-
-	do_build
-	popd
-}
-
-build_libosmoabis() {
-	pushd libosmo-abis
-
-	do_build
-	popd
-}
-
-build_libosmosccp() {
-	pushd libosmo-sccp
-
-	do_build
-	popd
-}
-
-build_osmoggsn() {
-	pushd osmo-ggsn
-	do_build
-	popd
-}
-
 build_openbsc() {
 	pushd openbsc/openbsc
 	#IU git checkout sysmocom/iu
 
 	do_build --enable-osmo-bsc --enable-nat --enable-smpp --enable-mgcp-transcoding #IU --enable-iu
-	popd
-}
-
-build_osmohlr() {
-	pushd osmo-hlr
-	do_build
 	popd
 }
 
@@ -107,66 +68,29 @@
 	popd
 }
 
-build_libosmodsp() {
-	pushd libosmo-dsp
-	do_build
-	popd
-}
-
-build_libosmonetif() {
-	pushd libosmo-netif
-	do_build
-	popd
-}
-
-build_osmogmr() {
-	pushd osmo-gmr
-	do_build
-	popd
-}
-
-build_libsmpp34() {
-	pushd libsmpp34
-	do_build
-	popd
-}
-
-build_osmosipconnector() {
-	pushd osmo-sip-connector
-	do_build
-	popd
-}
-
-build_osmotrx() {
-	pushd osmo-trx
-	do_build
-	popd
-}
-
 cd "$src_dir"
 
 rm -rf "$prefix"
 
 build_layer1api
-build_asn1c
-build_libosmocore
+build_default asn1c
+build_default libosmocore
 build_libasn1c
-build_libosmoabis
-build_libosmonetif
-build_libosmosccp
-build_libsmpp34
-build_osmoggsn
-#IU build_osmoiuh
+build_default libosmo-abis
+build_default libosmo-netif
+build_default libosmo-sccp
+build_default libsmpp34
+build_default osmo-ggsn
+#IU build_default osmo-iuh
 build_osmopcu
 build_osmobts
 build_openbsc
-build_osmohlr
 
 # GMR
-build_libosmodsp
-build_osmogmr
+build_default libosmo-dsp
+build_default osmo-gmr
 
 # MNCC to SIP
-build_osmosipconnector
+build_default osmo-sip-connector
 
-build_osmotrx
+build_default osmo-trx

-- 
To view, visit https://gerrit.osmocom.org/4207
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27e9fc94142b42a7b7c2f9eca89056e1f90f1f0e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>


More information about the gerrit-log mailing list