[Qa-jenkins-scm] [jenkins.debian.net] 01/03: schroot-create: use a HEREDOC instead of 3 different echo|sudo tee

Mattia Rizzolo mattia at debian.org
Wed Apr 4 17:51:13 UTC 2018


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository jenkins.debian.net.

commit 68a6719a54160831385605b6229d0c8f6d20ffef
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Wed Apr 4 19:46:57 2018 +0200

    schroot-create: use a HEREDOC instead of 3 different echo|sudo tee
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 bin/schroot-create.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/bin/schroot-create.sh b/bin/schroot-create.sh
index b4f8025..7a97a32 100755
--- a/bin/schroot-create.sh
+++ b/bin/schroot-create.sh
@@ -153,9 +153,13 @@ bootstrap() {
 	if [ ! -z "$http_proxy" ] ; then
 		echo "Acquire::http::Proxy \"$http_proxy\";" | sudo tee    $SCHROOT_TARGET/etc/apt/apt.conf.d/80proxy >/dev/null
 	fi
-	echo "# generated by $BUILD_URL"              | sudo tee    $SCHROOT_TARGET/etc/apt/sources.list > /dev/null
-	echo "deb $MIRROR $SUITE main $CONTRIB"       | sudo tee -a $SCHROOT_TARGET/etc/apt/sources.list > /dev/null
-	echo "deb-src $MIRROR $SUITE main $CONTRIB"   | sudo tee -a $SCHROOT_TARGET/etc/apt/sources.list > /dev/null
+
+	# configure the APT sources
+	sudo tee "$SCHROOT_TARGET/etc/apt/sources.list" > /dev/null <<-__END__
+	# generated by $BUILD_URL
+	deb $MIRROR $SUITE main $CONTRIB
+	deb-src $MIRROR $SUITE main $CONTRIB
+	__END__
 	for i in $(seq 0 7) ; do
 		[ -z "${EXTRA_SOURCES[$i]}" ] || echo "${EXTRA_SOURCES[$i]}"                     | sudo tee -a $SCHROOT_TARGET/etc/apt/sources.list >/dev/null
 	done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list