]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
install-deps.sh: use tee for writing a file
authorKefu Chai <kchai@redhat.com>
Thu, 14 Dec 2017 11:06:51 +0000 (19:06 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 14 Dec 2017 11:06:53 +0000 (19:06 +0800)
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

index 75728e81e24f0953c881fa4cb089b1300338bb5f..b8c1f8a1b3fd70a0883b495cf5183aac9a23b5d5 100755 (executable)
@@ -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