From 5751988b556ef354b3689e82406ddc9df8d39547 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 12 Apr 2019 18:39:58 +0200 Subject: [PATCH] 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 --- pkgs/common-updater/scripts/update-source-version | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version index e1eece1fbf40..591ffa6ca5ba 100755 --- a/pkgs/common-updater/scripts/update-source-version +++ b/pkgs/common-updater/scripts/update-source-version @@ -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 '"')