fixed for build with centos / yum

master
Marc Wäckerlin 6 years ago
parent 2e41294684
commit 46d4c0d3cf
  1. 7
      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') 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
;; ;;
(fedora|centos|mageia) # numeric code name (fedora|mageia) # numeric code name
CODENAME=$(docker exec ${DOCKER_ID} lsb_release -rs) 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 esac
if test "${arg/:::/}" = "${arg}"; then if test "${arg/:::/}" = "${arg}"; then
cmd_tmp="${cmd//ARG/${arg//@DISTRIBUTOR@/${DISTRIBUTOR}}}" cmd_tmp="${cmd//ARG/${arg//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
@ -336,7 +339,7 @@ EOF
docker exec -i ${DOCKER_ID} rm rpm-key docker exec -i ${DOCKER_ID} rm rpm-key
done done
for repo in "${repos[@]}"; do 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" ifthenelse "${repo}" "${INSTALL_REPO} ARG"
((++i)) ((++i))
done done

Loading…
Cancel
Save