3
0
Fork 0
forked from mirrors/nixpkgs

common-updater-scripts: simplify fetchgit fix

No need to try evaluate the URL twice as introduced in the original fix
cce486838b
This commit is contained in:
Jan Tojnar 2019-04-12 18:39:58 +02:00
parent 1b507bea4d
commit 5751988b55
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4

View file

@ -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 '"')