From e428f3fedab9c646bac8459e968fdcdcca16f610 Mon Sep 17 00:00:00 2001 From: Umair Khan Date: Wed, 19 Oct 2016 13:10:54 +0500 Subject: [PATCH] Run apt-get update only if sources.list has changed. Fixes: #2025 --- scripts/lib/setup-apt-repo | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/lib/setup-apt-repo b/scripts/lib/setup-apt-repo index 42b86fa0e7..9102069441 100755 --- a/scripts/lib/setup-apt-repo +++ b/scripts/lib/setup-apt-repo @@ -1,6 +1,9 @@ #!/bin/bash set -x +SOURCES_FILE=/etc/apt/sources.list.d/zulip.list +zulip_source_hash=`shasum $SOURCES_FILE` + apt-get install -y lsb-release SCRIPTS_PATH="$(dirname $(dirname $0))" @@ -21,4 +24,8 @@ else exit 1 fi -apt-get update +if [ "$zulip_source_hash" = "`shasum $SOURCES_FILE`" ]; then + echo "zulip.list file did not change; skipping apt-get update" +else + apt-get update +fi