From 9a1bf524f52cc662abf85b2737f7d0f5037bb85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Gr=C3=A4fenstein?= Date: Wed, 29 Sep 2021 16:00:00 +0200 Subject: [PATCH 1/3] common-updater-scripts/list-git-tags: don't print commands --- pkgs/common-updater/scripts/list-git-tags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/common-updater/scripts/list-git-tags b/pkgs/common-updater/scripts/list-git-tags index ff09671c7cb0..61658342c3a5 100755 --- a/pkgs/common-updater/scripts/list-git-tags +++ b/pkgs/common-updater/scripts/list-git-tags @@ -1,4 +1,4 @@ -#! /bin/sh -x +#! /bin/sh # lists all available tags from a git repository From 8ae7cd8a93ce916e13bf6bdd76bf5ff68f6e333c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Gr=C3=A4fenstein?= Date: Wed, 29 Sep 2021 16:41:19 +0200 Subject: [PATCH 2/3] common-updater-scripts/*: /bin/sh -> /usr/bin/env bash --- pkgs/common-updater/scripts/list-archive-two-level-versions | 2 +- pkgs/common-updater/scripts/list-git-tags | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/common-updater/scripts/list-archive-two-level-versions b/pkgs/common-updater/scripts/list-archive-two-level-versions index e46652820ad2..36a051e97c91 100755 --- a/pkgs/common-updater/scripts/list-archive-two-level-versions +++ b/pkgs/common-updater/scripts/list-archive-two-level-versions @@ -1,4 +1,4 @@ -#! /bin/sh +#!/usr/bin/env bash # lists all available versions listed for a package in a site (http) diff --git a/pkgs/common-updater/scripts/list-git-tags b/pkgs/common-updater/scripts/list-git-tags index 61658342c3a5..d137552cdd66 100755 --- a/pkgs/common-updater/scripts/list-git-tags +++ b/pkgs/common-updater/scripts/list-git-tags @@ -1,4 +1,4 @@ -#! /bin/sh +#!/usr/bin/env bash # lists all available tags from a git repository From 17d18904e2bed21deea8f65cef27f741adb4ab08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Gr=C3=A4fenstein?= Date: Fri, 1 Oct 2021 18:37:21 +0200 Subject: [PATCH 3/3] common-updater-scripts/update-source-version: Fix on Nix 2.4 --- pkgs/common-updater/scripts/update-source-version | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version index d5c23466ee03..0ac6b3cf8c28 100755 --- a/pkgs/common-updater/scripts/update-source-version +++ b/pkgs/common-updater/scripts/update-source-version @@ -188,7 +188,9 @@ tempHash=$(printf '%0*d' "$hashLength" 0) if [[ -n "$sri" ]]; then # SRI hashes only support base64 # SRI hashes need to declare the hash type as part of the hash - tempHash="$(nix to-sri --type "$oldHashAlgo" "$tempHash")" + tempHash="$(nix hash to-sri --type "$oldHashAlgo" "$tempHash" 2>/dev/null \ + || nix to-sri --type "$oldHashAlgo" "$tempHash" 2>/dev/null)" \ + || die "Failed to convert hash to SRI representation!" fi # Escape regex metacharacter that are allowed in hashes (+) @@ -232,7 +234,9 @@ if [[ -z "$newHash" ]]; then if [[ -n "$sri" ]]; then # nix-build preserves the hashing scheme so we can just convert the result to SRI using the old type - newHash="$(nix to-sri --type "$oldHashAlgo" "$newHash")" + newHash="$(nix hash to-sri --type "$oldHashAlgo" "$newHash" 2>/dev/null \ + || nix to-sri --type "$oldHashAlgo" "$newHash" 2>/dev/null)" \ + || die "Failed to convert hash to SRI representation!" fi fi