From 69adf156ef737e283e04ed675ee52bd27c7e660d Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 13 Jul 2024 02:53:43 +0200 Subject: [PATCH] common-updater-scripts: Fix u-s-v updating npmDeps `buildNpmDeps` pass `npmDepsHash` as `hash` to `fetchNpmDeps` so `npmDeps` does not contain `outputHashAlgo` attribute. This would cause the program fail as follows: $ update-source-version zx --ignore-same-version --source-key=npmDeps error: attribute 'outputHashAlgo' in selection path 'zx.npmDeps.drvAttrs.outputHashAlgo' not found update-source-version: error: Couldn't evaluate old source hash from 'zx.npmDeps'! --- pkgs/common-updater/scripts/update-source-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version index 8196c81054e2..626c8f8261c0 100755 --- a/pkgs/common-updater/scripts/update-source-version +++ b/pkgs/common-updater/scripts/update-source-version @@ -134,7 +134,7 @@ if [[ -z "$nixFile" ]]; then fi fi -oldHashAlgo=$(nix-instantiate $systemArg --eval --strict -A "$attr.$sourceKey.drvAttrs.outputHashAlgo" | tr -d '"') +oldHashAlgo=$(nix-instantiate $systemArg --eval --strict -E "let pkgs = $importTree; in pkgs.$attr.$sourceKey.drvAttrs.outputHashAlgo or pkgs.$attr.$sourceKey.drvAttrs.outputHash" | tr -d '"' | sed "s/-.*//") oldHash=$(nix-instantiate $systemArg --eval --strict -A "$attr.$sourceKey.drvAttrs.outputHash" | tr -d '"') if [[ -z "$oldHashAlgo" || -z "$oldHash" ]]; then