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
This commit is contained in:
Oliver Smith 2021-04-27 15:34:23 +02:00
parent 797e4aa386
commit 5ef41781aa
3 changed files with 52 additions and 0 deletions

View File

@ -171,6 +171,27 @@ osmo_obs_distro_specific_patch() {
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 @@ osmo_obs_checkout_copy() {
local repo="$2"
local patch
if osmo_obs_skip_pkg "$repo"; then
return
fi
echo
echo "====> Checking out $repo-$distro"

View File

@ -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 @@ checkout() {
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 @@ build() {
project=$1
gitbpargs="$2"
output="$DEBSRCDIR/$project"
if osmo_obs_skip_pkg "$project"; then
return
fi
echo
echo "====> Building $project"
cd "$TOP/$project"

View File

@ -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 @@ checkout() {
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 @@ build() {
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 @@ post() {
}
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_limesuite() {
}
checkout_open5gs() {
if osmo_obs_skip_pkg "open5gs"; then
return
fi
cd "$REPO"
git clone https://github.com/open5gs/open5gs
cd open5gs