mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Merge pull request #10006 from edolstra/fix-impure-fetchurl
<nix/fetchurl.nix>: Restore support for "impure = true"
This commit is contained in:
commit
2b946aad8e
3 changed files with 9 additions and 5 deletions
|
@ -23,9 +23,8 @@ void builtinFetchurl(
|
|||
if (!out)
|
||||
throw Error("'builtin:fetchurl' requires an 'out' output");
|
||||
|
||||
auto dof = std::get_if<DerivationOutput::CAFixed>(&out->raw);
|
||||
if (!dof)
|
||||
throw Error("'builtin:fetchurl' must be a fixed-output derivation");
|
||||
if (!(drv.type().isFixed() || drv.type().isImpure()))
|
||||
throw Error("'builtin:fetchurl' must be a fixed-output or impure derivation");
|
||||
|
||||
auto storePath = outputs.at("out");
|
||||
auto mainUrl = drv.env.at("url");
|
||||
|
@ -64,7 +63,8 @@ void builtinFetchurl(
|
|||
};
|
||||
|
||||
/* Try the hashed mirrors first. */
|
||||
if (dof->ca.method.getFileIngestionMethod() == FileIngestionMethod::Flat)
|
||||
auto dof = std::get_if<DerivationOutput::CAFixed>(&out->raw);
|
||||
if (dof && dof->ca.method.getFileIngestionMethod() == FileIngestionMethod::Flat)
|
||||
for (auto hashedMirror : settings.hashedMirrors.get())
|
||||
try {
|
||||
if (!hasSuffix(hashedMirror, "/")) hashedMirror += '/';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue