From 51cd0c4b2a0073bd5faf2ca9cacc703425310825 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Thu, 18 Nov 2021 22:11:03 +0000 Subject: [PATCH] Use SRI hashes on jlink --- externals/packages/jlink/default.nix | 2 +- externals/packages/jlink/update.py | 4 ++-- externals/packages/jlink/version.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/externals/packages/jlink/default.nix b/externals/packages/jlink/default.nix index 614b532..3ddf30c 100644 --- a/externals/packages/jlink/default.nix +++ b/externals/packages/jlink/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { version = conf.version; src = fetchurl { - inherit (conf) url sha256 curlOpts; + inherit (conf) url hash curlOpts; }; dontConfigure = true; diff --git a/externals/packages/jlink/update.py b/externals/packages/jlink/update.py index 81655ff..44c9d7a 100755 --- a/externals/packages/jlink/update.py +++ b/externals/packages/jlink/update.py @@ -30,12 +30,12 @@ for nix_arch, jlink_arch in arches: url = URL_FORMAT.format(version=version.replace('.', ''), arch=jlink_arch) out = subprocess.run( ['nix-prefetch', f'{{fetchurl}}: fetchurl {{ url = "{url}"; curlOpts = "{CURL_OPTS}"; }}'], stdout=subprocess.PIPE, check=True) - sha256 = out.stdout.decode('utf8').strip() + file_hash = out.stdout.decode('utf8').strip() out_obj[nix_arch] = { 'url': url, 'version': version, 'curlOpts': CURL_OPTS, - 'sha256': sha256 + 'hash': file_hash } out_file = open(os.path.join(BASE_DIR, 'version.json'), 'w') diff --git a/externals/packages/jlink/version.json b/externals/packages/jlink/version.json index 69bf000..a4ee79d 100644 --- a/externals/packages/jlink/version.json +++ b/externals/packages/jlink/version.json @@ -1 +1 @@ -{"x86_64-linux": {"url": "https://www.segger.com/downloads/jlink/JLink_Linux_V758b_x86_64.tgz", "version": "7.58b", "curlOpts": "-d accept_license_agreement=accepted -d submit=Download+software", "sha256": "sha256-kr1zCzvGx4pmhPeWEoXlouOMnZY69V59/cF8hakv7ps="}, "i686-linux": {"url": "https://www.segger.com/downloads/jlink/JLink_Linux_V758b_i686.tgz", "version": "7.58b", "curlOpts": "-d accept_license_agreement=accepted -d submit=Download+software", "sha256": "sha256-d8gVsn3hYU39m15Tu5VkqOnocPTXyuCKmvLZsRw6fNw="}, "armv7l-linux": {"url": "https://www.segger.com/downloads/jlink/JLink_Linux_V758b_arm.tgz", "version": "7.58b", "curlOpts": "-d accept_license_agreement=accepted -d submit=Download+software", "sha256": "sha256-ze5EEjboQuT4UVxw/rU3w4Pgsk5yHoLARURQxonl26w="}, "aarch64-linux": {"url": "https://www.segger.com/downloads/jlink/JLink_Linux_V758b_arm64.tgz", "version": "7.58b", "curlOpts": "-d accept_license_agreement=accepted -d submit=Download+software", "sha256": "sha256-NFzo2udZ2ZuHdwG4ZGftI139LZPIrdso5adiMG09uh0="}} \ No newline at end of file +{"x86_64-linux": {"url": "https://www.segger.com/downloads/jlink/JLink_Linux_V758b_x86_64.tgz", "version": "7.58b", "curlOpts": "-d accept_license_agreement=accepted -d submit=Download+software", "hash": "sha256-kr1zCzvGx4pmhPeWEoXlouOMnZY69V59/cF8hakv7ps="}, "i686-linux": {"url": "https://www.segger.com/downloads/jlink/JLink_Linux_V758b_i686.tgz", "version": "7.58b", "curlOpts": "-d accept_license_agreement=accepted -d submit=Download+software", "hash": "sha256-d8gVsn3hYU39m15Tu5VkqOnocPTXyuCKmvLZsRw6fNw="}, "armv7l-linux": {"url": "https://www.segger.com/downloads/jlink/JLink_Linux_V758b_arm.tgz", "version": "7.58b", "curlOpts": "-d accept_license_agreement=accepted -d submit=Download+software", "hash": "sha256-ze5EEjboQuT4UVxw/rU3w4Pgsk5yHoLARURQxonl26w="}, "aarch64-linux": {"url": "https://www.segger.com/downloads/jlink/JLink_Linux_V758b_arm64.tgz", "version": "7.58b", "curlOpts": "-d accept_license_agreement=accepted -d submit=Download+software", "hash": "sha256-NFzo2udZ2ZuHdwG4ZGftI139LZPIrdso5adiMG09uh0="}} \ No newline at end of file