From 257a25f5910643d5a3f74442f7c6330e5d9ff464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 6 Feb 2018 11:04:54 +0100 Subject: [PATCH] Improve source setup --- conf/python_source.src | 2 ++ scripts/_common.sh | 3 --- scripts/install | 7 ++++++- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 conf/python_source.src diff --git a/conf/python_source.src b/conf/python_source.src new file mode 100644 index 0000000..4d05e76 --- /dev/null +++ b/conf/python_source.src @@ -0,0 +1,2 @@ +SOURCE_URL=https://github.com/matrix-org/synapse/archive/v0.26.0.tar.gz +SOURCE_SUM=234dd5fa44895e855d11fbf50de9184d057977b10b296f594d2c3758f693eff3 diff --git a/scripts/_common.sh b/scripts/_common.sh index f7216cc..e69de29 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,3 +0,0 @@ -#!/bin/bash - -src_sum="234dd5fa44895e855d11fbf50de9184d057977b10b296f594d2c3758f693eff3" diff --git a/scripts/install b/scripts/install index 496d05a..3747d9d 100644 --- a/scripts/install +++ b/scripts/install @@ -158,7 +158,12 @@ else pip install --upgrade pip pip install --upgrade setuptools pip install --upgrade cffi ndg-httpsclient psycopg2 lxml - wget -nv -O synapse_source.tar.gz https://github.com/matrix-org/synapse/archive/v$upstream_version.tar.gz + + # Download and check the checksum for the synapse source + src_url=$(grep 'SOURCE_URL=' "$YNH_CWD/../conf/python_source.src" | cut -d= -f2-) + src_sum=$(grep 'SOURCE_SUM=' "$YNH_CWD/../conf/python_source.src" | cut -d= -f2-) + + wget -nv -O synapse_source.tar.gz "$src_url" echo "${src_sum} synapse_source.tar.gz" | sha256sum -c --status \ || ynh_die "Corrupt source" pip install --upgrade synapse_source.tar.gz