From 7d3154e1c7023d42410b6bd815cbeb7dc5eb27ee Mon Sep 17 00:00:00 2001 From: Liam McLoughlin Date: Sat, 21 Apr 2012 14:28:22 +0100 Subject: [PATCH] Add check to make sure Git is installed before we attempt update/setup --- rpi-update | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rpi-update b/rpi-update index a129822..06b1c48 100755 --- a/rpi-update +++ b/rpi-update @@ -8,10 +8,17 @@ FW_GPU=$((256-FW_RAM)) echo "Raspberry Pi firmware updater by Hexxeh" if [[ $EUID -ne 0 ]]; then - echo "This tool must be run as root" 1>&2 + echo "This tool must be run as root" exit 1 fi +command -v git >/dev/null 2>&1 || { + echo "This tool requires you have Git installed, please install it first" + echo "In Debian, try: sudo apt-get install git-core" + echo "In Arch, try: pacman -Sy git" + exit 1 +} + echo "Using memory split of ${FW_RAM}MB/${FW_GPU}MB" GITCMD="git --git-dir=${FW_PATH}/.git --work-tree=${FW_PATH}"