diff options
author | Oliver Smith <osmith@sysmocom.de> | 2021-01-22 10:34:39 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2021-01-25 10:27:26 +0100 |
commit | 9318ea87204438d6c9c1b3b2729006381ec6347e (patch) | |
tree | 0b66a013829a2d0af9bbbdfed2ec54dadf05b8bb | |
parent | 4813fb7fd9587a9c8e816b4afb2d0e86833c08d7 (diff) |
repo-install-test: resolve distro obs dir in func
Instead of hardcoding CentOS_8 in the centos code path, and Debian_9.0
in the debian code path, resolve the proper OBS directory based on
$DISTRO.
Related: OS#4969
Change-Id: Ie537e8befeebd7958b2a1fe8f6fd54587cfcb1b6
-rwxr-xr-x | scripts/repo-install-test/run-inside-docker.sh | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/scripts/repo-install-test/run-inside-docker.sh b/scripts/repo-install-test/run-inside-docker.sh index 2e9d6a8..355b668 100755 --- a/scripts/repo-install-test/run-inside-docker.sh +++ b/scripts/repo-install-test/run-inside-docker.sh @@ -37,6 +37,23 @@ SERVICES_NIGHTLY=" osmo-bts-virtual " +distro_obsdir() { + case "$DISTRO" in + centos8) + echo "CentOS_8" + ;; + debian) + echo "Debian_9.0" + ;; + *) + echo "ERROR: unknown obsdir for '$DISTRO'." >&2 + exit 1 + ;; + esac +} + +DISTRO_OBSDIR="$(distro_obsdir)" + # $1: OBS project (e.g. "network:osmocom:nightly" -> "network:/osmocom:/nightly") proj_with_slashes() { echo "$1" | sed "s.:.:/.g" @@ -82,7 +99,7 @@ check_env() { # $1: OBS project (e.g. "network:osmocom:nightly") configure_osmocom_repo_debian() { local proj="$1" - local obs_repo="download.opensuse.org/repositories/$(proj_with_slashes "$proj")/Debian_9.0/" + local obs_repo="download.opensuse.org/repositories/$(proj_with_slashes "$proj")/$DISTRO_OBSDIR/" local release_key="/var/cache/apt/${proj}_Release.key" echo "Configuring Osmocom repository" @@ -107,7 +124,7 @@ configure_osmocom_repo_debian_remove() { # $1: OBS project (e.g. "network:osmocom:nightly") configure_osmocom_repo_centos() { local proj="$1" - local baseurl="https://download.opensuse.org/repositories/$(proj_with_slashes "$proj")/CentOS_8" + local baseurl="https://download.opensuse.org/repositories/$(proj_with_slashes "$proj")/$DISTRO_OBSDIR" echo "Configuring Osmocom repository" # Generate this file, based on the feed: @@ -256,7 +273,7 @@ filter_packages_txt() { } install_repo_packages_debian() { - local obs="obs://build.opensuse.org/$PROJ/Debian_9.0" + local obs="obs://build.opensuse.org/$PROJ/$DISTRO_OBSDIR" echo "Installing all repository packages" |