Commit cd13136f authored by Yueh-Shun Li's avatar Yueh-Shun Li
Browse files

fetchurl: use __structuredAttrs = true and pass curlOptsList directly

parent 45357774
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
source "$NIX_ATTRS_SH_FILE"
source $mirrorsFile

curlVersion=$(curl -V | head -1 | cut -d' ' -f2)
@@ -22,10 +23,10 @@ if ! [ -f "$SSL_CERT_FILE" ]; then
    curl+=(--insecure)
fi

eval "curl+=($curlOptsList)"
curl+=("${curlOptsList[@]}")

curl+=(
    $curlOpts
    ${curlOpts[*]}
    $NIX_CURL_FLAGS
)

+4 −2
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ lib.extendMkDerivation {

      # Passthru information, if any.
      passthru ? { },

      # Doing the download on a remote machine just duplicates network
      # traffic, so don't do that by default
      preferLocalBuild ? true,
@@ -238,6 +239,8 @@ lib.extendMkDerivation {

    derivationArgs
    // {
      __structuredAttrs = true;

      name =
        if finalAttrs.pname or null != null && finalAttrs.version or null != null then
          "${finalAttrs.pname}-${finalAttrs.version}"
@@ -297,9 +300,8 @@ lib.extendMkDerivation {
        ''
      ) curlOpts;

      curlOptsList = lib.escapeShellArgs curlOptsList;

      inherit
        curlOptsList
        downloadToTemp
        executable
        mirrorsFile