[PR #718] [CLOSED] Fix curl check regression and simplify #904

Closed
opened 2025-12-29 01:29:55 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dehydrated-io/dehydrated/pull/718
Author: @krayon
Created: 3/16/2020
Status: Closed

Base: masterHead: fix.01.curlcheck


📝 Commits (3)

  • 8f0ecc3 Fix curl check
  • 5e2c53e Use existing curl version var
  • 9aef215 Simplier/faster/safer curl version retrieval

📊 Changes

1 file changed (+3 additions, -2 deletions)

View changed files

📝 dehydrated (+3 -2)

📄 Description

This fixes #717 by capturing the output into a string for later version extraction.

Additionally, it replaces the subshell calls to head and awk with basic
bash read which is 95+ times faster (in my tests, based on 100000
iterations), simpler and safer (no forking that could fail etc).

NOTE: You'll notice I'm not redirecting stderr anymore. Even the oldest
version of curl I could find (4.8 from 2000) still outputs to stdout so I'm
not sure why this is being captured.

Lastly, it also reuses the curl version information previously obtained for the
command_version() function.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dehydrated-io/dehydrated/pull/718 **Author:** [@krayon](https://github.com/krayon) **Created:** 3/16/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix.01.curlcheck` --- ### 📝 Commits (3) - [`8f0ecc3`](https://github.com/dehydrated-io/dehydrated/commit/8f0ecc3b7286f46da95f98c36179eef88a8108f8) Fix curl check - [`5e2c53e`](https://github.com/dehydrated-io/dehydrated/commit/5e2c53e0ffe8d9667f036dcbc4568488a6d8f300) Use existing curl version var - [`9aef215`](https://github.com/dehydrated-io/dehydrated/commit/9aef215bc15df86b624c10fdd367dd6ab42b8afa) Simplier/faster/safer curl version retrieval ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `dehydrated` (+3 -2) </details> ### 📄 Description This fixes #717 by capturing the output into a string for later version extraction. Additionally, it replaces the subshell calls to `head` and `awk` with basic `bash` `read` which is 95+ times faster (in my tests, based on 100000 iterations), simpler and safer (no forking that could fail etc). **NOTE:** You'll notice I'm not redirecting `stderr` anymore. Even the oldest version of `curl` I could find (4.8 from 2000) still outputs to `stdout` so I'm not sure why this is being captured. Lastly, it also reuses the curl version information previously obtained for the `command_version()` function. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 01:29:55 +01:00
adam closed this issue 2025-12-29 01:29:55 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#904