Ports: Add argparse v3.2 and improve run() and curl helpers - #26934
Ports: Add argparse v3.2 and improve run() and curl helpers#26934tbhaxor wants to merge 3 commits into
Conversation
Define curlopts with --fail, --location, --silent, and --show-error, and expand it as an array at the download call site. That removes the extra --fail -L flags from do_download_file and keeps downloads quiet while still printing errors. These flags match the common -fsSL shorthand.
Replace the hand-rolled `echo "+ $@"` traces in run() and run_nocd() with `set -x` inside the existing subshells. Bash then prints the invoked command with proper quoting. run_nocd() sets PS4 to `+ (nocd) ` so traces still show the nocd marker. run() enables xtrace after changing directory so `cd $workdir` is not printed on every call.
|
|
||
| installedpackagesdb="${DESTDIR}/usr/Ports/installed.db" | ||
|
|
||
| curlopts=(--fail --location --silent --show-error) |
There was a problem hiding this comment.
Why do we want the download to be silent?
There was a problem hiding this comment.
It's more of to silent the noisy progress which doesn't get live updated. So its better to silent this, mainly error should be shown.
|
|
||
| Defaults to `configure`. | ||
|
|
||
| #### `curlopts` |
There was a problem hiding this comment.
Nothing is using this, and I don't think ports should be involved in deciding how exactly their declared files get downloaded.
There was a problem hiding this comment.
Nice point, although port include includes curlopts but it wasn't documented. This changes does that.
If you are still not convinced, I can remove this. Lmk
linusg
left a comment
There was a problem hiding this comment.
It also seems a bit pointless to add a library port that no other port depends on?
I see what you are trying so take. Will remove this in the following fixups. Can you plz re-review the PR in mean time? |
No description provided.