|
|
|
@ -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}}" |
|
|
|
|