Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wget -O needs to be passed as first argument #2669

Closed
tlaurion opened this issue May 1, 2023 · 6 comments
Closed

wget -O needs to be passed as first argument #2669

tlaurion opened this issue May 1, 2023 · 6 comments
Labels
Bug Stuff that's wrong

Comments

@tlaurion
Copy link

tlaurion commented May 1, 2023

https://github.com/DeterminateSystems/nix-installer/blob/5a58cf20bec1b34f62e11709a60ed60d2d640353/nix-installer.sh#L314 doesn't work.

Only wget -O /tmp/nix-installer https://install.determinate.systems/nix/tag/v0.8.0/nix-installer-x86_64-linux works, but most tools pass -O after URL, not before.

-O should not be positional and only working if provided as first argument...


When applied on top of #2668 manually packed under u-root cpio:

~ # wget  https://install.determinate.systems/nix/tag/v0.8.0/nix-installer-x86_64-linux -O -O /tmp/nix-installer
~ # ls /tmp/nix-installer 
ls: /tmp/nix-installer: No such file or directory
@tlaurion tlaurion added the Bug Stuff that's wrong label May 1, 2023
@rminnich
Copy link
Member

rminnich commented May 1, 2023

I see -O twice, are you sure it did not pull it down to a file name -O?

@rminnich
Copy link
Member

rminnich commented May 1, 2023

it's not that it is positional, it's that the go flag package takes the standard of switches first and then args.

wget's rules around args are very non-standard, but we have little choice but to honor them, including the -- I suppose. Quite the mess.

@tlaurion
Copy link
Author

tlaurion commented May 1, 2023

I see -O twice, are you sure it did not pull it down to a file name -O?

Bad copy paste

@rminnich
Copy link
Member

rminnich commented May 1, 2023

man wget | grep '^ *--'|wc
wow. 174 options.
This is truly a work of art.

@tlaurion
Copy link
Author

tlaurion commented May 1, 2023

wow. 174 options. This is truly a work of art.

@rminnich yeah... Sometimes less is more.
Idea is not to try to replicate all of them, but i'm not sure it's acceptable that -O is not respected after an URL. I kinda agree that src:dst idiom is applied in all scripts I have came across. Kinda weird to expect dst:src.

Nothing can be done here? Even if ugly, if wget is dealing only with one argument (-O) it should tolerate having dst passed after source.

Then asking on a use case basis for fix where too tight on expression should be possible for all other u-root applets. But serisouly.... Without wget support, its impossible to get anything "in".

@tlaurion
Copy link
Author

tlaurion commented May 2, 2023

Fixed per 83a242b

@tlaurion tlaurion closed this as completed May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Stuff that's wrong
Projects
None yet
Development

No branches or pull requests

2 participants