From 84f60c19cee0b4727e4d78562aca3347a17302e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Osztrogon=C3=A1c?= Date: Thu, 14 Nov 2019 10:20:30 +0100 Subject: [PATCH] Fixing sudo usage for dependency installation (#3315) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #3288, the fix is same as the bug reporter suggested. JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu --- tools/apt-get-install-deps.sh | 8 ++++++-- tools/apt-get-install-qemu-arm.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/apt-get-install-deps.sh b/tools/apt-get-install-deps.sh index 7df3ebc1b..f4f39640f 100755 --- a/tools/apt-get-install-deps.sh +++ b/tools/apt-get-install-deps.sh @@ -14,8 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo apt-get update -q -sudo apt-get install -q -y \ +if [ "$(whoami)" != "root" ]; then + SUDO=sudo +fi + +${SUDO} apt-get update -q +${SUDO} apt-get install -q -y \ make cmake \ gcc gcc-multilib \ doxygen \ diff --git a/tools/apt-get-install-qemu-arm.sh b/tools/apt-get-install-qemu-arm.sh index 7658ccd6b..b38373bb4 100755 --- a/tools/apt-get-install-qemu-arm.sh +++ b/tools/apt-get-install-qemu-arm.sh @@ -14,7 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo apt-get update -q -sudo apt-get install -q -y \ +if [ "$(whoami)" != "root" ]; then + SUDO=sudo +fi + +${SUDO} apt-get update -q +${SUDO} apt-get install -q -y \ gcc-arm-linux-gnueabihf libc6-dev-armhf-cross \ qemu-user-static