Change in osmo-ci[master]: OBS: add PACKAGES env var

osmith gerrit-no-reply at lists.osmocom.org
Thu Apr 29 14:08:41 UTC 2021


osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/23952 )

Change subject: OBS: add PACKAGES env var
......................................................................

OBS: add PACKAGES env var

Skip checking out and building source packages of all other packages, if
the environment variable is set.

Related: SYS#5370
Change-Id: I83c3744713fd6abda4b832460f30eb2e79ebeed8
---
M scripts/common-obs.sh
M scripts/osmocom-latest-packages.sh
M scripts/osmocom-nightly-packages.sh
3 files changed, 52 insertions(+), 0 deletions(-)

Approvals:
  osmith: Verified
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/scripts/common-obs.sh b/scripts/common-obs.sh
index c5b03f9..156dfba 100644
--- a/scripts/common-obs.sh
+++ b/scripts/common-obs.sh
@@ -171,6 +171,27 @@
 	fi
 }
 
+# Check if checkout or build of a given package should be skipped, based on the
+# PACKAGES environment variable.
+# $1: package name (e.g. "libosmocore")
+osmo_obs_skip_pkg() {
+	local pkgname="$1"
+
+	if [ -z "$PACKAGES" ]; then
+		# Don't skip
+		return 1
+	fi
+
+	for i in "osmocom-$FEED" $PACKAGES; do
+		if [ "$i" = "$pkgname" ]; then
+			return 1
+		fi
+	done
+
+	# Skip
+	return 0
+}
+
 # Copy an already checked out repository dir and apply a distribution specific patch.
 # $PWD must be where all repositories are checked out in subdirs.
 # $1: distribution name (e.g. "debian8")
@@ -180,6 +201,10 @@
 	local repo="$2"
 	local patch
 
+	if osmo_obs_skip_pkg "$repo"; then
+		return
+	fi
+
 	echo
 	echo "====> Checking out $repo-$distro"
 
diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh
index e3c9452..301c6c6 100755
--- a/scripts/osmocom-latest-packages.sh
+++ b/scripts/osmocom-latest-packages.sh
@@ -7,6 +7,7 @@
 #   * "latest": use latest tagged release (default)
 #   * other (e.g. "2021q1"): use last commit of branch of same name, exit with
 #     error if it does not exist
+# * PACKAGES: set to a space-separated list of packages to skip all others
 . "$(dirname "$0")/common.sh"
 . "$(dirname "$0")/common-obs.sh"
 
@@ -75,6 +76,10 @@
   url=$2
   gitbpargs=""
 
+  if osmo_obs_skip_pkg "$project"; then
+    return
+  fi
+
   if [ -z "$url" ]; then
     url="$(osmo_git_clone_url "$project")"
   fi
@@ -105,6 +110,11 @@
   project=$1
   gitbpargs="$2"
   output="$DEBSRCDIR/$project"
+
+  if osmo_obs_skip_pkg "$project"; then
+    return
+  fi
+
   echo
   echo "====> Building $project"
   cd "$TOP/$project"
diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh
index bcbb6f3..4fe0104 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -7,6 +7,7 @@
 # * FEED: controls the source branch that is used:
 #   * "nightly": use "master" branch (default)
 #   * "next": use "next" branch if it exists, otherwise use "master" branch
+# * PACKAGES: set to a space-separated list of packages to skip all others
 . "$(dirname "$0")/common.sh"
 . "$(dirname "$0")/common-obs.sh"
 
@@ -85,6 +86,10 @@
   local url=$2
   local branch=$3
 
+  if osmo_obs_skip_pkg "$name"; then
+    return
+  fi
+
   if [ -z "$url" ]; then
     url="$(osmo_git_clone_url "$name")"
   fi
@@ -118,6 +123,10 @@
   local oscdir=$REPO/osc/$PROJ/$name
   local dependver="$OSMO_OBS_CONFLICT_PKGVER"
 
+  if osmo_obs_skip_pkg "$name"; then
+    return
+  fi
+
   if [ -d "$oscdir" ] ; then
     # remove earlier version
     cd "$oscdir"
@@ -167,6 +176,10 @@
 }
 
 checkout_limesuite() {
+  if osmo_obs_skip_pkg "limesuite"; then
+    return
+  fi
+
   cd "$REPO"
   git clone https://github.com/myriadrf/LimeSuite limesuite
   TAG="$(get_last_tag limesuite)"
@@ -175,6 +188,10 @@
 }
 
 checkout_open5gs() {
+  if osmo_obs_skip_pkg "open5gs"; then
+    return
+  fi
+
   cd "$REPO"
   git clone https://github.com/open5gs/open5gs
   cd open5gs

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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I83c3744713fd6abda4b832460f30eb2e79ebeed8
Gerrit-Change-Number: 23952
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210429/6853eb82/attachment.htm>


More information about the gerrit-log mailing list