OBS: move verify_feed to common

Prepare to move the 2021q1 feed from latest to nightly.

Related: SYS#5370
Change-Id: I91e4c36d4a04d465fc9ccb933e8060511b7cd145
This commit is contained in:
Oliver Smith 2021-05-17 11:31:26 +02:00 committed by osmith
parent 16f324618f
commit 58d02c5483
3 changed files with 21 additions and 19 deletions

View File

@ -280,3 +280,17 @@ osmo_obs_get_commit_version() {
echo -n "$version"
}
# Verify that $FEED is in $FEEDS
osmo_obs_verify_feed() {
local i
for i in $FEEDS; do
if [ "$i" = "$FEED" ]; then
return
fi
done
echo "unsupported feed: $FEED"
exit 1
}

View File

@ -24,19 +24,6 @@ TOP=$(pwd)
DEBSRCDIR="$TOP/debsrc"
FEED="${FEED:-latest}"
verify_feed() {
local i
for i in $FEEDS; do
if [ "$i" = "$FEED" ]; then
return
fi
done
echo "unsupported feed: $FEED"
exit 1
}
### OBS build
prepare() {
# start with a checkout of the project
@ -259,5 +246,5 @@ build_osmocom() {
osc ci -m "$FEED versions of $DT" --noservice
}
verify_feed
osmo_obs_verify_feed
build_osmocom

View File

@ -11,6 +11,11 @@
. "$(dirname "$0")/common.sh"
. "$(dirname "$0")/common-obs.sh"
FEEDS="
next
nightly
"
set -e
set -x
@ -19,11 +24,6 @@ OSMO_OBS_CONFLICT_PKGVER="$OSMO_OBS_CONFLICT_PKGVER.$DT"
TOP=$(pwd)/$(mktemp -d nightly-3g_XXXXXX)
FEED="${FEED:-nightly}"
if [ "$FEED" != "nightly" ] && [ "$FEED" != "next" ]; then
echo "unsupported feed: $FEED"
exit 1
fi
### OBS build
prepare() {
# clean up the whole space
@ -269,4 +269,5 @@ build_osmocom() {
post
}
osmo_obs_verify_feed
build_osmocom