From 53863be8857a060cc69c40bf63bea62ab3735a70 Mon Sep 17 00:00:00 2001 From: Magnus Therning Date: Mon, 23 Jan 2017 08:40:28 +0100 Subject: [PATCH] Add command line switch to include testing repo in build images. Signed-off-by: Magnus Therning --- helpers/mk-docker-image | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/helpers/mk-docker-image b/helpers/mk-docker-image index f12775d7..67b4984f 100755 --- a/helpers/mk-docker-image +++ b/helpers/mk-docker-image @@ -22,6 +22,7 @@ hash mkarchroot &>/dev/null || { arch=$(uname -m) image_pfx=arch/habs +with_testing=no usage() { cat << EOF @@ -33,12 +34,13 @@ Options: -h This help -a Architecture to build for, i686 or x86_64 (default: local arch) -n Prefix for name of docker image (default: arch/habs) +-t Include the testing repo The image's complete name will be "-". EOF } -while getopts ha:n: opt; do +while getopts ha:n:t opt; do case "${opt}" in h) usage; exit 0 ;; a) if [[ "x${OPTARG}" == "xi686" ]]; then @@ -48,6 +50,7 @@ while getopts ha:n: opt; do fi ;; n) image_pfx="${OPTARG}" ;; + t) with_testing=yes esac done @@ -64,9 +67,17 @@ SigLevel = Never ##[repo] ##Server = file:///repo -#[haskell-testing] -#Server = http://xsounds.org/~haskell/testing/\$arch +EOF + +if [[ "${with_testing}" == "yes" ]]; then + cat >> "${pacman_conf}" << EOF +[haskell-testing] >> "${pacman_conf}" +Server = http://xsounds.org/~haskell/testing/\$arch >> "${pacman_conf}" + +EOF +fi +cat >> "${pacman_conf}" << EOF [haskell-core] Server = http://xsounds.org/~haskell/core/\$arch