Skip to content

Commit

Permalink
Fixes 3d87c6f - Invalid syntax for curl --time-cond
Browse files Browse the repository at this point in the history
According to Curl man page, syntax for --time-cond attribute
should be "--time-cond file <path>", not "--time-cond <path>".

This can cause issues with outdated vmlinuz and initrd.im files,
once the files are downloaded, they are never replaced with never versions.

[0] https://curl.se/docs/manpage.html
  • Loading branch information
stejskalleos committed Feb 23, 2023
1 parent 2d9cdce commit 15af1ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/proxy/http_download.rb
Expand Up @@ -26,7 +26,7 @@ def initialize(src, dst, connect_timeout: DEFAULT_CONNECT_TIMEOUT, verify_server
# keep last changed file attribute
args << "--remote-time"
# only download newer files
args += ["--time-cond", dst.to_s]
args += ["--time-cond", "file", dst.to_s]
# print stats in the end
args += [
"--write-out",
Expand Down
4 changes: 2 additions & 2 deletions test/http_download_test.rb
Expand Up @@ -17,7 +17,7 @@ def test_regular_call
"--retry-delay", "10",
"--max-time", "3600",
"--remote-time",
"--time-cond", "dst",
"--time-cond", "file", "dst",
"--write-out", "Task done, result: %{http_code}, size downloaded: %{size_download}b, speed: %{speed_download}b/s, time: %{time_total}ms",
"--output", "dst",
"--location", "src"
Expand All @@ -34,7 +34,7 @@ def test_regular_call_with_ssl_verify
"--retry-delay", "10",
"--max-time", "3600",
"--remote-time",
"--time-cond", "dst",
"--time-cond", "file", "dst",
"--write-out", "Task done, result: %{http_code}, size downloaded: %{size_download}b, speed: %{speed_download}b/s, time: %{time_total}ms",
"--output", "dst",
"--location", "src"
Expand Down

0 comments on commit 15af1ba

Please sign in to comment.