diff options
author | Robert Scott <code@humanleg.org.uk> | 2023-10-24 01:02:36 +0100 |
---|---|---|
committer | Robert Scott <code@humanleg.org.uk> | 2024-02-03 13:37:59 +0000 |
commit | 272f7bb1f4d02d42fc10fd26f21f4ca4c6f4d85a (patch) | |
tree | d173c8a4cdb0a1d5927c680de9c5deb8d169a5eb /pkgs/applications/science/misc/openrefine/update.sh | |
parent | 82ee069492ce894f02a2c6a9df42986269b428b9 (diff) |
openrefine: init at 3.7.7
Diffstat (limited to 'pkgs/applications/science/misc/openrefine/update.sh')
-rwxr-xr-x | pkgs/applications/science/misc/openrefine/update.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/applications/science/misc/openrefine/update.sh b/pkgs/applications/science/misc/openrefine/update.sh new file mode 100755 index 0000000000000..545a5bd4e1982 --- /dev/null +++ b/pkgs/applications/science/misc/openrefine/update.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p nix nix-update + +set -euxo pipefail + +nix-update "${UPDATE_NIX_ATTR_PATH}" +nix-update "${UPDATE_NIX_ATTR_PATH}.npmPkg" --version=skip + +FILE="$(nix-instantiate --eval -E 'with import ./. {}; (builtins.unsafeGetAttrPos "version" '"${UPDATE_NIX_ATTR_PATH}"').file' | tr -d '"')" + +MVNHASH_OLD=$(nix-instantiate --eval . -A "${UPDATE_NIX_ATTR_PATH}.mvnHash" | tr -d '"') +MVNHASH_OLD_ESCAPED=$(echo "${MVNHASH_OLD}" | sed -re 's|[+]|\\&|g') +FAKEHASH=$(nix-instantiate --eval . -A "lib.fakeHash" | tr -d '"') +FAKEHASH_ESCAPED=$(echo "${FAKEHASH}" | sed -re 's|[+]|\\&|g') + +sed -E -i "s|${MVNHASH_OLD_ESCAPED}|${FAKEHASH}|g" "${FILE}" + +MVNHASH_NEW="$(nix-build . -A "${UPDATE_NIX_ATTR_PATH}" 2>&1 | tail -n10 | grep 'got:' | cut -d: -f2- | xargs echo || true)" + +sed -E -i "s|${FAKEHASH_ESCAPED}|${MVNHASH_NEW}|g" "${FILE}" |