Skip to content

Commit 5f6be51

Browse files
mikhailnovharaldh
authored andcommitted
fix(url-lib): fix passing args
Fixes: 8e84fa7 ("fix(url-lib): shellcheck for modules.d/45url-lib") Behaviour introduced by that commit made the following to be run: curl "--globoff --location --retry 3 --fail --show-error" http://192.168.1.173:8000/test.ks instead of: curl --globoff --location --retry 3 --fail --show-error http://192.168.1.173:8000/test.ks This broke downloading kickstart file in anaconda-dracut.
1 parent 61f4564 commit 5f6be51

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

modules.d/45url-lib/url-lib.sh

+10-5
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,15 @@ curl_fetch_url() {
6666
local url="$1" outloc="$2"
6767
echo "$url" > /proc/self/fd/0
6868
if [ -n "$outloc" ]; then
69-
curl "$curl_args" --output - -- "$url" > "$outloc" || return $?
69+
# shellcheck disable=SC2086
70+
curl $curl_args --output - -- "$url" > "$outloc" || return $?
7071
else
7172
local outdir
7273
outdir="$(mkuniqdir /tmp curl_fetch_url)"
7374
(
7475
cd "$outdir" || exit
75-
curl "$curl_args" --remote-name "$url" || return $?
76+
# shellcheck disable=SC2086
77+
curl $curl_args --remote-name "$url" || return $?
7678
)
7779
outloc="$outdir/$(ls -A "$outdir")"
7880
fi
@@ -98,13 +100,15 @@ ctorrent_fetch_url() {
98100
torrent_outloc="$outloc.torrent"
99101
echo "$url" > /proc/self/fd/0
100102
if [ -n "$outloc" ]; then
101-
curl "$curl_args" --output - -- "$url" > "$torrent_outloc" || return $?
103+
# shellcheck disable=SC2086
104+
curl $curl_args --output - -- "$url" > "$torrent_outloc" || return $?
102105
else
103106
local outdir
104107
outdir="$(mkuniqdir /tmp torrent_fetch_url)"
105108
(
106109
cd "$outdir" || exit
107-
curl "$curl_args" --remote-name "$url" || return $?
110+
# shellcheck disable=SC2086
111+
curl $curl_args --remote-name "$url" || return $?
108112
)
109113
torrent_outloc="$outdir/$(ls -A "$outdir")"
110114
outloc=${torrent_outloc%.*}
@@ -113,7 +117,8 @@ ctorrent_fetch_url() {
113117
warn "Downloading '$url' failed!"
114118
return 253
115119
fi
116-
ctorrent "$ctorrent_args" -s "$outloc" "$torrent_outloc" >&2
120+
# shellcheck disable=SC2086
121+
ctorrent $ctorrent_args -s "$outloc" "$torrent_outloc" >&2
117122
if ! [ -f "$outloc" ]; then
118123
warn "Torrent download of '$url' failed!"
119124
return 253

0 commit comments

Comments
 (0)