2016-08-05 22:27:03 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -x
|
|
|
|
|
2016-10-19 10:10:54 +02:00
|
|
|
SOURCES_FILE=/etc/apt/sources.list.d/zulip.list
|
|
|
|
zulip_source_hash=`shasum $SOURCES_FILE`
|
|
|
|
|
2016-10-12 03:14:58 +02:00
|
|
|
apt-get install -y lsb-release
|
|
|
|
|
|
|
|
SCRIPTS_PATH="$(dirname $(dirname $0))"
|
|
|
|
# Add the apt keys
|
|
|
|
apt-key add "$SCRIPTS_PATH"/setup/zulip-ppa.asc
|
|
|
|
apt-key add "$SCRIPTS_PATH"/setup/pgroonga-ppa.asc
|
2016-08-05 22:27:03 +02:00
|
|
|
|
|
|
|
release=$(lsb_release -sc)
|
2017-07-30 13:37:57 +02:00
|
|
|
if [ "$release" = "trusty" ] || [ "$release" = "xenial" ] || [ "$release" = "zesty" ]; then
|
2016-08-05 22:27:03 +02:00
|
|
|
cat >/etc/apt/sources.list.d/zulip.list <<EOF
|
2016-10-12 03:14:58 +02:00
|
|
|
deb http://ppa.launchpad.net/groonga/ppa/ubuntu $release main
|
2016-08-05 22:27:03 +02:00
|
|
|
deb http://ppa.launchpad.net/tabbott/zulip/ubuntu $release main
|
2016-10-12 03:14:58 +02:00
|
|
|
deb-src http://ppa.launchpad.net/groonga/ppa/ubuntu $release main
|
2016-08-05 22:27:03 +02:00
|
|
|
deb-src http://ppa.launchpad.net/tabbott/zulip/ubuntu $release main
|
|
|
|
EOF
|
2017-07-15 01:23:39 +02:00
|
|
|
elif [ "$release" = "stretch" ]; then
|
|
|
|
apt-get install -y -V apt-transport-https
|
|
|
|
apt-key add "$SCRIPTS_PATH"/setup/pgroonga-debian.asc
|
|
|
|
cat >/etc/apt/sources.list.d/zulip.list <<EOF
|
|
|
|
deb https://packages.groonga.org/debian/ stretch main
|
|
|
|
deb-src https://packages.groonga.org/debian/ stretch main
|
|
|
|
EOF
|
2016-08-05 22:27:03 +02:00
|
|
|
else
|
|
|
|
echo "Unsupported release $release."
|
|
|
|
exit 1
|
|
|
|
fi
|
2016-10-16 09:56:58 +02:00
|
|
|
|
2016-10-19 10:10:54 +02:00
|
|
|
if [ "$zulip_source_hash" = "`shasum $SOURCES_FILE`" ]; then
|
|
|
|
echo "zulip.list file did not change; skipping apt-get update"
|
|
|
|
else
|
|
|
|
apt-get update
|
|
|
|
fi
|