fixed for build with opensuse tumbleweed and leap

master
Marc Wäckerlin 6 years ago
parent 82241e1752
commit 2f1339b6c5
  1. 2
      build-in-docker.conf
  2. 18
      build-in-docker.sh

@ -12,5 +12,5 @@
repos+=("ubuntu:::universe") repos+=("ubuntu:::universe")
# Use Marc Wäckerlin's Repository, see https://mrw.sh # Use Marc Wäckerlin's Repository, see https://mrw.sh
repos+=("debian|ubuntu:::https://repository.mrw.sh:::https://repository.mrw.sh/@DISTRIBUTOR@/marc-waeckerlin.repo") repos+=("debian|ubuntu:::https://repository.mrw.sh:::https://repository.mrw.sh/@DISTRIBUTOR@/@CODENAME@ marc-waeckerlin")
keys+=("https://repository.mrw.sh/PublicKey") keys+=("https://repository.mrw.sh/PublicKey")

@ -200,11 +200,17 @@ function ifthenelse() {
arg="$1" arg="$1"
shift shift
cmd="$*" cmd="$*"
DISTRIBUTOR=$(docker exec ${DOCKER_ID} lsb_release -si | sed 's, .*,,' | tr [:upper:] [:lower:]) DISTRIBUTOR=$(docker exec ${DOCKER_ID} lsb_release -si | sed 's, .*,,;s,.*,\L&,g')
CODENAME=$(docker exec ${DOCKER_ID} lsb_release -cs) 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) 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
if test "${arg/:::/}" = "${arg}"; then if test "${arg/:::/}" = "${arg}"; then
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${arg//@DISTRIBUTOR@/${DISTRIBUTOR}}}" cmd_tmp="${cmd//ARG/${arg//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
docker exec ${DOCKER_ID} bash -c "${cmd_tmp//@CODENAME@/${CODENAME}}"
else else
os="${arg%%:::*}" os="${arg%%:::*}"
thenpart="${arg#*:::}" thenpart="${arg#*:::}"
@ -215,11 +221,13 @@ function ifthenelse() {
fi fi
if [[ "${DISTRIBUTOR}-${CODENAME}-${ARCH}" =~ ${os} ]]; then if [[ "${DISTRIBUTOR}-${CODENAME}-${ARCH}" =~ ${os} ]]; then
if test -n "${thenpart}"; then if test -n "${thenpart}"; then
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${thenpart//@DISTRIBUTOR@/${DISTRIBUTOR}}}" cmd_tmp="${cmd//ARG/${thenpart//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
docker exec ${DOCKER_ID} bash -c "${cmd_tmp//@CODENAME@/${CODENAME}}"
fi fi
else else
if test -n "${elsepart}"; then if test -n "${elsepart}"; then
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${elsepart//@DISTRIBUTOR@/${DISTRIBUTOR}}}" cmd_tmp="${cmd//ARG/${elsepart//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
docker exec ${DOCKER_ID} bash -c "${cmd_tmp//@CODENAME@/${CODENAME}}"
fi fi
fi fi
fi fi
@ -324,7 +332,7 @@ EOF
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 wget -O/etc/yum.repos.d/additional$i.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
for package in "${packages[@]}"; do for package in "${packages[@]}"; do

Loading…
Cancel
Save