mirror of https://gerrit.osmocom.org/osmo-ci
OBS: check required programs before start
osmocom-*-packages.sh take some time to execute and has quite a few programs that are not commonly installed. Check the required dependencies first, so it doesn't abort in the middle of the scripts if these are missing. I just ran into this with the new meson dependency. Change-Id: I46cf1aeedd61dbd4fc8fa3f24c60e29033339ead
This commit is contained in:
parent
4969d2b116
commit
a36c355462
|
@ -1,6 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Various common code used in the OBS (opensuse build service) related osmo-ci shell scripts
|
# Various common code used in the OBS (opensuse build service) related osmo-ci shell scripts
|
||||||
|
|
||||||
|
osmo_cmd_require \
|
||||||
|
dch \
|
||||||
|
dh \
|
||||||
|
dpkg-buildpackage \
|
||||||
|
gbp \
|
||||||
|
git \
|
||||||
|
meson \
|
||||||
|
mktemp \
|
||||||
|
osc \
|
||||||
|
patch \
|
||||||
|
sed \
|
||||||
|
wget
|
||||||
|
|
||||||
# Create the source for a dummy package, that conflicts with another dummy package in the current directory. Example
|
# Create the source for a dummy package, that conflicts with another dummy package in the current directory. Example
|
||||||
# of the structure that will be generated:
|
# of the structure that will be generated:
|
||||||
# osmocom-nightly
|
# osmocom-nightly
|
||||||
|
|
|
@ -157,3 +157,18 @@ docker_images_require() {
|
||||||
cd "$oldpwd"
|
cd "$oldpwd"
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Abort the script if required programs are missing
|
||||||
|
# $1...$n: program name
|
||||||
|
osmo_cmd_require() {
|
||||||
|
local fail=0
|
||||||
|
for i in "$@"; do
|
||||||
|
if ! command -v "$i" >/dev/null 2>&1; then
|
||||||
|
echo "Required program not found: $i"
|
||||||
|
fail=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ "$fail" = 1 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
@ -15,11 +15,6 @@ DT=$(date +%Y%m%d)
|
||||||
TOP=$(pwd)
|
TOP=$(pwd)
|
||||||
DEBSRCDIR="$TOP/debsrc"
|
DEBSRCDIR="$TOP/debsrc"
|
||||||
|
|
||||||
if ! which osc >/dev/null 2>/dev/null ; then
|
|
||||||
echo "osc binary not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
### OBS build
|
### OBS build
|
||||||
prepare() {
|
prepare() {
|
||||||
# start with a checkout of the project
|
# start with a checkout of the project
|
||||||
|
|
|
@ -14,11 +14,6 @@ PROJ=network:osmocom:nightly
|
||||||
DT=$(date +%Y%m%d)
|
DT=$(date +%Y%m%d)
|
||||||
TOP=$(pwd)/$(mktemp -d nightly-3g_XXXXXX)
|
TOP=$(pwd)/$(mktemp -d nightly-3g_XXXXXX)
|
||||||
|
|
||||||
if ! which osc >/dev/null 2>/dev/null ; then
|
|
||||||
echo "osc binary not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
### OBS build
|
### OBS build
|
||||||
prepare() {
|
prepare() {
|
||||||
# clean up the whole space
|
# clean up the whole space
|
||||||
|
|
Loading…
Reference in New Issue