Run apt-get update only if sources.list has changed.

Fixes: #2025
This commit is contained in:
Umair Khan
2016-10-19 13:10:54 +05:00
parent 83f902953a
commit e428f3feda

View File

@@ -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