From dbc0170ed998484178780d9390ae0d4434bf93b0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 Aug 2007 09:24:06 +0000 Subject: [PATCH] * Show errors in nix-prefetch-url. --- scripts/nix-prefetch-url.in | 2 +- scripts/nix-pull.in | 5 +++-- scripts/nix-push.in | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/nix-prefetch-url.in b/scripts/nix-prefetch-url.in index 186804d8e2..5621d5204a 100644 --- a/scripts/nix-prefetch-url.in +++ b/scripts/nix-prefetch-url.in @@ -37,7 +37,7 @@ fi doDownload() { - @curl@ $cacheFlags --fail -# --show-error --location --max-redirs 20 --disable-epsv \ + @curl@ $cacheFlags --fail -# --location --max-redirs 20 --disable-epsv \ --cookie-jar $tmpPath/cookies "$url" -o $tmpFile } diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in index 333a1df87b..016e330dcb 100644 --- a/scripts/nix-pull.in +++ b/scripts/nix-pull.in @@ -36,8 +36,9 @@ sub downloadFile { $ENV{"PRINT_PATH"} = 1; $ENV{"QUIET"} = 1; my ($dummy, $path) = `$binDir/nix-prefetch-url '$url'`; - chomp $path; + die "cannot fetch `$url'" if $? != 0; die "nix-prefetch-url did not return a path" unless defined $path; + chomp $path; return $path; } @@ -70,7 +71,7 @@ sub processURL { } if (readManifest($manifest, \%narFiles, \%localPaths, \%patches) < 3) { - die "manifest `$url' is too old (i.e., for Nix <= 0.7)\n"; + die "`$url' is not manifest or it is too old (i.e., for Nix <= 0.7)\n"; } if ($skipWrongStore) { diff --git a/scripts/nix-push.in b/scripts/nix-push.in index e5bd404a2d..992622fbb4 100644 --- a/scripts/nix-push.in +++ b/scripts/nix-push.in @@ -265,7 +265,7 @@ print STDERR "uploading manifest...\n"; if ($localCopy) { copyFile $manifest, $localManifestFile; } else { - system("$curl --show-error --upload-file " . + system("$curl --show-error --upload-file " . "'$manifest' '$manifestPutURL' > /dev/null") == 0 or die "curl failed on $manifest: $?"; }