mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 12:29:02 +02:00
Revert "adding NIX_CONTINUE_DOWNLOADS feature, see mkdir comment"
This reverts commit -r16401 svn path=/nixpkgs/trunk/; revision=16405
This commit is contained in:
parent
13e3c0d7b9
commit
ec0e356b9a
|
@ -23,19 +23,8 @@ tryDownload() {
|
||||||
echo
|
echo
|
||||||
header "trying $url"
|
header "trying $url"
|
||||||
success=
|
success=
|
||||||
cache_file="/var/nix-downloads/$outputHash"
|
if $curl --fail "$url" --output "$out"; then
|
||||||
if { test -n "$NIX_CONTINUE_DOWNLOADS" && touch "$cache_file";}; then
|
success=1
|
||||||
chmod g+w $cache_file # ensure another nixbld user can continue!
|
|
||||||
# no locking is taking place. I think nix builder locking is enough
|
|
||||||
if $curl --fail "$url" -C - --output "$cache_file"; then
|
|
||||||
mv "$cache_file" "$out"
|
|
||||||
chmod g-w $out # ensure another nixbld user can continue!
|
|
||||||
success=1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if $curl --fail "$url" --output "$out"; then
|
|
||||||
success=1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
stopNest
|
stopNest
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Argh, this thing is duplicated (more-or-less) in Nix (in corepkgs).
|
# Argh, this thing is duplicated (more-or-less) in Nix (in corepkgs).
|
||||||
# Need to find a way to combine them.
|
# Need to find a way to combine them.
|
||||||
|
|
||||||
{stdenv, curl, getConfig ? (x: y : "")}: # Note that `curl' may be `null', in case of the native stdenv.
|
{stdenv, curl}: # Note that `curl' may be `null', in case of the native stdenv.
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -86,18 +86,6 @@ stdenv.mkDerivation {
|
||||||
if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
||||||
outputHash = if outputHash != "" then outputHash else
|
outputHash = if outputHash != "" then outputHash else
|
||||||
if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
|
if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# set this to any value to make nix dowload into /var/nix-downloads/$hash
|
|
||||||
# so that it can continue a half finished download after a shudown,
|
|
||||||
# susupend to disk, shutdown etc
|
|
||||||
# for this to work you have to run
|
|
||||||
# d=/var/nix-downloads; mkdir $d; chgrp nixbld $d; chmod g+x $d;
|
|
||||||
# once
|
|
||||||
# defaulting to enabled because continuing takes place only if $d exists
|
|
||||||
# and has proper permissions
|
|
||||||
NIX_CONTINUE_DOWNLOADS = getConfig ["NIX_CONTINUE_DOWNLOADS"] "1";
|
|
||||||
|
|
||||||
impureEnvVars = [
|
impureEnvVars = [
|
||||||
# We borrow these environment variables from the caller to allow
|
# We borrow these environment variables from the caller to allow
|
||||||
|
|
|
@ -282,7 +282,7 @@ let
|
||||||
# from being built.
|
# from being built.
|
||||||
fetchurl = useFromStdenv "fetchurl"
|
fetchurl = useFromStdenv "fetchurl"
|
||||||
(import ../build-support/fetchurl {
|
(import ../build-support/fetchurl {
|
||||||
inherit curl stdenv getConfig;
|
inherit curl stdenv;
|
||||||
});
|
});
|
||||||
|
|
||||||
# fetchurlBoot is used for curl and its dependencies in order to
|
# fetchurlBoot is used for curl and its dependencies in order to
|
||||||
|
|
Loading…
Reference in a new issue