From 2e41294684ade92d2b35aec5869bd60c490449ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 19 Sep 2018 08:21:55 +0000 Subject: [PATCH] fixed for build with opensuse tumbleweed and leap - and fedora, centos, mageia --- build-in-docker.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build-in-docker.sh b/build-in-docker.sh index c1c5279..ab4ecaa 100755 --- a/build-in-docker.sh +++ b/build-in-docker.sh @@ -203,11 +203,16 @@ function ifthenelse() { DISTRIBUTOR=$(docker exec ${DOCKER_ID} lsb_release -si | sed 's, .*,,;s,.*,\L&,g') CODENAME=$(docker exec ${DOCKER_ID} lsb_release -cs) ARCH=$((docker exec ${DOCKER_ID} which dpkg > /dev/null 2> /dev/null && docker exec ${DOCKER_ID} dpkg --print-architecture) || echo amd64) - if test "$CODENAME" = "n/a"; then - if test "$DISTRIBUTOR" = "opensuse"; then - 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 - fi + case "$DISTRIBUTOR" in + (opensuse) # code name may be not available, then set leap or tumbleweed + if test "$CODENAME" = "n/a"; then + 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 + CODENAME=$(docker exec ${DOCKER_ID} lsb_release -rs) + ;; + esac if test "${arg/:::/}" = "${arg}"; then cmd_tmp="${cmd//ARG/${arg//@DISTRIBUTOR@/${DISTRIBUTOR}}}" docker exec ${DOCKER_ID} bash -c "${cmd_tmp//@CODENAME@/${CODENAME}}"