Change in osmo-gsm-tester[master]: build: Add overload to clone repo and build in subdirectory

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/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Sat Sep 15 10:04:10 UTC 2018


Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/10970


Change subject: build: Add overload to clone repo and build in subdirectory
......................................................................

build: Add overload to clone repo and build in subdirectory

To build osmo-nitb we need to clone "openbsc" and then enter the
"openbsc" sub-directory. For building "mobile" and "virt_phy" of
OsmocomBB we will need to do something similar. Instead of added
more hardcoded paths, add a variant that allows to specify the
source directory.

Change-Id: I67fbd54296f2c68316bf8e89cfeb37d147193d53
---
M contrib/jenkins-build-common.sh
M contrib/jenkins-build-osmo-nitb.sh
2 files changed, 14 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/70/10970/1

diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh
index 731bf58..c2ffbb4 100644
--- a/contrib/jenkins-build-common.sh
+++ b/contrib/jenkins-build-common.sh
@@ -12,6 +12,7 @@
 # build_repo libosmocore --configure --opts
 # build_repo libosmo-foo special_branch --configure --opts
 # build_repo osmo-bar
+# build_repo_dir openbsc ./openbsc
 #
 # create_bin_tgz
 #--------------
@@ -98,11 +99,19 @@
 
 build_repo() {
   # usage: build_repo <name> [<branch>] [--configure-opts [...]]
+  dir="$1"
+  shift
+  build_repo_dir "${dir}" "./" $@
+}
+
+build_repo_dir() {
+  # usage: build_repo_dir <name> <dir> [<branch>] [--configure-opts [...]]
   dep="$1"
+  dir="$2"
   branch="master"
-  if [ -z "$(echo "$2" | grep '^-')" ]; then
+  if [ -z "$(echo "$3" | grep '^-')" ]; then
     # second arg does not start with a dash, it's empty or a branch
-    branch="$2"
+    branch="$3"
     if [ -n "$branch" ]; then
       # we had a branch arg, need to shift once more to get config options
       shift
@@ -111,6 +120,7 @@
     fi
   fi
   shift
+  shift
   configure_opts="$@"
 
   set +x; echo "
@@ -122,12 +132,7 @@
 
   have_repo "$dep" "$branch"
 
-  cd "$dep"
-
-  # special shim: we know the openbsc.git needs to be built in the openbsc/ subdir.
-  if [ "$dep" = "openbsc" ]; then
-    cd openbsc
-  fi
+  cd "$dep/${dir}"
 
   set +x; echo; echo; set -x
   autoreconf -fi
diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh
index 1e3ecc6..4f81fa8 100755
--- a/contrib/jenkins-build-osmo-nitb.sh
+++ b/contrib/jenkins-build-osmo-nitb.sh
@@ -10,6 +10,6 @@
 build_repo openggsn
 build_repo libsmpp34
 build_repo libosmo-sccp
-build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat
+build_repo_dir openbsc openbsc --enable-smpp --enable-osmo-bsc --enable-nat
 
 create_bin_tgz "osmo-nitb osmo-bsc_mgcp"

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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I67fbd54296f2c68316bf8e89cfeb37d147193d53
Gerrit-Change-Number: 10970
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther <holger at freyther.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180915/3b105455/attachment.htm>


More information about the gerrit-log mailing list