From 46d4c0d3cf626b4c98cc3c516057eab051a9c7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 19 Sep 2018 11:22:26 +0000 Subject: [PATCH] fixed for build with centos / yum --- build-in-docker.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build-in-docker.sh b/build-in-docker.sh index ab4ecaa..a53edc7 100755 --- a/build-in-docker.sh +++ b/build-in-docker.sh @@ -209,9 +209,12 @@ function ifthenelse() { CODENAME=$(docker exec ${DOCKER_ID} lsb_release -ds | sed "s,\($(docker exec ${DOCKER_ID} lsb_release -si | sed 's, ,\\|,g')\) *,,"';s, .*,,g;s,",,g;s,.*,\L&,g') fi ;; - (fedora|centos|mageia) # numeric code name + (fedora|mageia) # numeric code name CODENAME=$(docker exec ${DOCKER_ID} lsb_release -rs) ;; + (centos) # only look at major number in centos + CODENAME=$(docker exec ${DOCKER_ID} lsb_release -rs | sed 's,\..*,,') + ;; esac if test "${arg/:::/}" = "${arg}"; then cmd_tmp="${cmd//ARG/${arg//@DISTRIBUTOR@/${DISTRIBUTOR}}}" @@ -336,7 +339,7 @@ EOF docker exec -i ${DOCKER_ID} rm rpm-key done for repo in "${repos[@]}"; do - INSTALL_REPO=$((docker exec ${DOCKER_ID} test -x /usr/bin/zypper && echo zypper ar) || (docker exec ${DOCKER_ID} test -x /usr/bin/dnf && echo dnf config-manager --add-repo) || (docker exec ${DOCKER_ID} test -x /usr/bin/yum && echo wget -O/etc/yum.repos.d/additional$i.repo) || (docker exec ${DOCKER_ID} test -x /usr/sbin/urpmi && echo false)) + INSTALL_REPO=$((docker exec ${DOCKER_ID} test -x /usr/bin/zypper && echo zypper ar) || (docker exec ${DOCKER_ID} test -x /usr/bin/dnf && echo dnf config-manager --add-repo) || (docker exec ${DOCKER_ID} test -x /usr/bin/yum && echo yum-config-manager --add-repo) || (docker exec ${DOCKER_ID} test -x /usr/sbin/urpmi && echo false)) ifthenelse "${repo}" "${INSTALL_REPO} ARG" ((++i)) done