Skip to content

Commit cd13136

Browse files
committed
fetchurl: use __structuredAttrs = true and pass curlOptsList directly
1 parent 4535777 commit cd13136

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pkgs/build-support/fetchurl/builder.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
source "$NIX_ATTRS_SH_FILE"
12
source $mirrorsFile
23

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

25-
eval "curl+=($curlOptsList)"
26+
curl+=("${curlOptsList[@]}")
2627

2728
curl+=(
28-
$curlOpts
29+
${curlOpts[*]}
2930
$NIX_CURL_FLAGS
3031
)
3132

pkgs/build-support/fetchurl/default.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ lib.extendMkDerivation {
136136

137137
# Passthru information, if any.
138138
passthru ? { },
139+
139140
# Doing the download on a remote machine just duplicates network
140141
# traffic, so don't do that by default
141142
preferLocalBuild ? true,
@@ -238,6 +239,8 @@ lib.extendMkDerivation {
238239

239240
derivationArgs
240241
// {
242+
__structuredAttrs = true;
243+
241244
name =
242245
if finalAttrs.pname or null != null && finalAttrs.version or null != null then
243246
"${finalAttrs.pname}-${finalAttrs.version}"
@@ -297,9 +300,8 @@ lib.extendMkDerivation {
297300
''
298301
) curlOpts;
299302

300-
curlOptsList = lib.escapeShellArgs curlOptsList;
301-
302303
inherit
304+
curlOptsList
303305
downloadToTemp
304306
executable
305307
mirrorsFile

0 commit comments

Comments
 (0)