|
|
@ -24,6 +24,7 @@ if test -e ./build-in-docker.conf; then |
|
|
|
# if you do so, add the file to EXTRA_DIST in makefile.am |
|
|
|
# if you do so, add the file to EXTRA_DIST in makefile.am |
|
|
|
source ./build-in-docker.conf |
|
|
|
source ./build-in-docker.conf |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
while test $# -gt 0; do |
|
|
|
while test $# -gt 0; do |
|
|
|
case "$1" in |
|
|
|
case "$1" in |
|
|
|
(-h|--help) |
|
|
|
(-h|--help) |
|
|
@ -102,7 +103,7 @@ while test $# -gt 0; do |
|
|
|
targets="$1" |
|
|
|
targets="$1" |
|
|
|
if test "$1" = "deb" -o "$1" = "rpm"; then |
|
|
|
if test "$1" = "deb" -o "$1" = "rpm"; then |
|
|
|
# set mode to same value |
|
|
|
# set mode to same value |
|
|
|
set -- "-m" $@ |
|
|
|
set -- "-m" "$@" |
|
|
|
continue |
|
|
|
continue |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
@ -113,6 +114,7 @@ while test $# -gt 0; do |
|
|
|
flags+=("$1") |
|
|
|
flags+=("$1") |
|
|
|
;; |
|
|
|
;; |
|
|
|
(-r|--repo) shift; |
|
|
|
(-r|--repo) shift; |
|
|
|
|
|
|
|
echo "OPTION: $1" |
|
|
|
repos+=("$1") |
|
|
|
repos+=("$1") |
|
|
|
;; |
|
|
|
;; |
|
|
|
(-k|--key) shift; |
|
|
|
(-k|--key) shift; |
|
|
@ -227,7 +229,7 @@ fi |
|
|
|
if ! docker exec ${DOCKER_ID} getent passwd $(id -u) > /dev/null 2>&1; then |
|
|
|
if ! docker exec ${DOCKER_ID} getent passwd $(id -u) > /dev/null 2>&1; then |
|
|
|
docker exec ${DOCKER_ID} useradd -m -u $(id -u) -g $(id -g) -d"${HOME}" $(id -un) |
|
|
|
docker exec ${DOCKER_ID} useradd -m -u $(id -u) -g $(id -g) -d"${HOME}" $(id -un) |
|
|
|
fi |
|
|
|
fi |
|
|
|
docker exec ${DOCKER_ID} chown -R $(id -u).$(id -g) "${HOME}" /workdir |
|
|
|
docker exec ${DOCKER_ID} chown $(id -u):$(id -g) "${HOME}" |
|
|
|
case $mode in |
|
|
|
case $mode in |
|
|
|
(deb|apt) |
|
|
|
(deb|apt) |
|
|
|
if [[ "${img}" =~ "ubuntu" ]]; then |
|
|
|
if [[ "${img}" =~ "ubuntu" ]]; then |
|
|
@ -246,7 +248,7 @@ case $mode in |
|
|
|
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} software-properties-common apt-transport-https dpkg-dev lsb-release || \ |
|
|
|
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} software-properties-common apt-transport-https dpkg-dev lsb-release || \ |
|
|
|
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties apt-transport-https dpkg-dev lsb-release; |
|
|
|
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties apt-transport-https dpkg-dev lsb-release; |
|
|
|
for repo in "${repos[@]}"; do |
|
|
|
for repo in "${repos[@]}"; do |
|
|
|
ifthenelse "${repo}" "apt-add-repository ARG" |
|
|
|
ifthenelse "${repo}" "apt-add-repository 'ARG'" |
|
|
|
done |
|
|
|
done |
|
|
|
for key in "${keys[@]}"; do |
|
|
|
for key in "${keys[@]}"; do |
|
|
|
wget -O- "$key" \ |
|
|
|
wget -O- "$key" \ |
|
|
@ -284,7 +286,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 true)) |
|
|
|
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 true)) |
|
|
|
ifthenelse "${repo}" "${INSTALL_REPO} ARG" |
|
|
|
ifthenelse "${repo}" "${INSTALL_REPO} 'ARG'" |
|
|
|
((++i)) |
|
|
|
((++i)) |
|
|
|
done |
|
|
|
done |
|
|
|
docker exec ${DOCKER_ID} ./resolve-rpmbuilddeps.sh |
|
|
|
docker exec ${DOCKER_ID} ./resolve-rpmbuilddeps.sh |
|
|
|