common-updater-scripts: simplify fetchgit fix

No need to try evaluate the URL twice as introduced in the original fix
https://github.com/NixOS/nixpkgs/commit/cce486838b6c52dedfec1c93f60ebadb72c48431
This commit is contained in:
Jan Tojnar
2019-06-02 09:31:51 +02:00
parent 1b507bea4d
commit 5751988b55
@@ -86,14 +86,10 @@ if [ $(grep -c "$oldHash" "$nixFile") != 1 ]; then
die "Couldn't locate old source hash '$oldHash' (or it appeared more than once) in '$nixFile'!"
fi
oldUrl=$(nix-instantiate $systemArg --eval -E "with import ./. {}; builtins.elemAt $attr.src.drvAttrs.urls 0" | tr -d '"')
oldUrl=$(nix-instantiate $systemArg --eval -E "with import ./. {}; builtins.elemAt ($attr.src.drvAttrs.urls or [ $attr.src.url ]) 0" | tr -d '"')
if [ -z "$oldUrl" ]; then
oldUrl=$(nix-instantiate $systemArg --eval -E "with import ./. {}; $attr.src.url" | tr -d '"')
if [ -z "$oldUrl" ]; then
die "Couldn't evaluate source url from '$attr.src'!"
fi
die "Couldn't evaluate source url from '$attr.src'!"
fi
drvName=$(nix-instantiate $systemArg --eval -E "with import ./. {}; (builtins.parseDrvName $attr.name).name" | tr -d '"')