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'!
This commit is contained in:
Jan Tojnar 2024-07-13 02:53:43 +02:00
parent 9fc19b0866
commit 69adf156ef

View File

@ -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