From 18b8685e877d1d69282ff4f8616ab6ec21955973 Mon Sep 17 00:00:00 2001
From: David Baker <dave@matrix.org>
Date: Fri, 3 Apr 2020 19:21:39 +0100
Subject: [PATCH] Make the openssl version a variable

At least just hardcode it once rather than three times
---
 hak/matrix-seshat/fetchDeps.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/hak/matrix-seshat/fetchDeps.js b/hak/matrix-seshat/fetchDeps.js
index b777d01f..81194266 100644
--- a/hak/matrix-seshat/fetchDeps.js
+++ b/hak/matrix-seshat/fetchDeps.js
@@ -92,7 +92,9 @@ async function getSqlCipher(hakEnv, moduleInfo) {
 }
 
 async function getOpenSsl(hakEnv, moduleInfo) {
-    const openSslDir = path.join(moduleInfo.moduleDotHakDir, 'openssl-1.1.1d');
+    const osslVersion = '1.1.1f';
+
+    const openSslDir = path.join(moduleInfo.moduleDotHakDir, 'openssl-' + osslVersion);
 
     let haveOpenSsl;
     try {
@@ -104,7 +106,7 @@ async function getOpenSsl(hakEnv, moduleInfo) {
 
     if (haveOpenSsl) return;
 
-    const openSslTarball = path.join(moduleInfo.moduleDotHakDir, 'openssl-1.1.1d.tar.gz');
+    const openSslTarball = path.join(moduleInfo.moduleDotHakDir, 'openssl-' + osslVersion + '.tar.gz');
     let haveOpenSslTar;
     try {
         await fsProm.stat(openSslTarball);
@@ -113,7 +115,7 @@ async function getOpenSsl(hakEnv, moduleInfo) {
         haveOpenSslTar = false;
     }
     if (!haveOpenSslTar) {
-        await needle('get', 'https://www.openssl.org/source/openssl-1.1.1f.tar.gz', {
+        await needle('get', 'https://www.openssl.org/source/openssl-' + osslVersion + '.tar.gz', {
             follow: 10,
             output: openSslTarball,
         });