From 0beb846e57b94786e84c35927fe5ef3a67857fa3 Mon Sep 17 00:00:00 2001
From: Kefu Chai <kchai@redhat.com>
Date: Thu, 14 Dec 2017 19:06:51 +0800
Subject: [PATCH] install-deps.sh: use tee for writing a file

because the stdout redirect is performed by current shell not `$SUDO
cat`, so $SUDO does not help here. use `$SUDO tee` instead, which is
able to read the stdin and write to the given file just as expected.

Signed-off-by: Kefu Chai <kchai@redhat.com>
---
 install-deps.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/install-deps.sh b/install-deps.sh
index 75728e81e24..b8c1f8a1b3f 100755
--- a/install-deps.sh
+++ b/install-deps.sh
@@ -38,7 +38,7 @@ function ensure_decent_gcc_on_deb {
     local dist=$(lsb_release --short --codename)
 
     if [ ! -f /usr/bin/g++-${new} ]; then
-	$SUDO cat > /etc/apt/sources.list.d/ubuntu-toolchain-r.list <<EOF
+	$SUDO tee /etc/apt/sources.list.d/ubuntu-toolchain-r.list <<EOF
 deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu $dist main
 deb http://mirror.cs.uchicago.edu/ubuntu-toolchain-r $dist main
 deb http://mirror.yandex.ru/mirrors/launchpad/ubuntu-toolchain-r $dist main