Unverified Commit d5908353 authored by Philip Taron's avatar Philip Taron Committed by GitHub
Browse files

fetchers: uniformly support the `hash` attribute (#342173)

parents 3c221582 7c19bb37
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
{ stdenvNoCC, breezy }:
{ url, rev, sha256 }:
{ lib, stdenvNoCC, breezy }:
lib.fetchers.withNormalizedHash { } (
  { url, rev, outputHash, outputHashAlgo }:

  stdenvNoCC.mkDerivation {
    name = "bzr-export";
@@ -7,9 +8,9 @@ stdenvNoCC.mkDerivation {
    builder = ./builder.sh;
    nativeBuildInputs = [ breezy ];

  outputHashAlgo = "sha256";
    inherit outputHash outputHashAlgo;
    outputHashMode = "recursive";
  outputHash = sha256;

    inherit url rev;
  }
)
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ if test -z "$hashType"; then
    hashType=sha256
fi
if test -z "$hashFormat"; then
    hashFormat=--base32
    hashFormat=--sri
fi

if test -z "$url"; then
+11 −10
Original line number Diff line number Diff line
@@ -6,17 +6,18 @@
{stdenvNoCC, cvs, openssh, lib}:

lib.makeOverridable (
{cvsRoot, module, tag ? null, date ? null, sha256}:
  lib.fetchers.withNormalizedHash { } (
    {cvsRoot, module, tag ? null, date ? null, outputHash, outputHashAlgo}:

    stdenvNoCC.mkDerivation {
      name = "cvs-export";
      builder = ./builder.sh;
      nativeBuildInputs = [cvs openssh];

  outputHashAlgo = "sha256";
      inherit outputHash outputHashAlgo;
      outputHashMode = "recursive";
  outputHash = sha256;

  inherit cvsRoot module sha256 tag date;
      inherit cvsRoot module tag date;
    }
  )
)
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ if test -z "$finalPath"; then
    (cd "$tmpPath" && cvs -f -z0 -d $cvsRoot export "${args[*]}" -d cvs-export $module >&2)

    # Compute the hash.
    hash=$(nix-hash --type $hashType $hashFormat $tmpFile)
    hash=$(nix-hash --type $hashType ${hashFormat:-"--sri"} $tmpFile)
    if ! test -n "$QUIET"; then echo "hash is $hash" >&2; fi

    # Add the downloaded file to the Nix store.
+16 −14
Original line number Diff line number Diff line
{stdenvNoCC, darcs, cacert, lib}:

lib.makeOverridable (
  lib.fetchers.withNormalizedHash { } (
    { url
    , rev ? null
    , context ? null
, sha256 ? ""
    , outputHash ? lib.fakeHash
    , outputHashAlgo ? null
    , name ? "fetchdarcs"
    }:

@@ -12,10 +14,10 @@ stdenvNoCC.mkDerivation {
      builder = ./builder.sh;
      nativeBuildInputs = [cacert darcs];

  outputHashAlgo = "sha256";
      inherit outputHash outputHashAlgo;
      outputHashMode = "recursive";
  outputHash = sha256;

      inherit url rev context name;
    }
  )
)
Loading