Page MenuHomeFreeBSD

fwget: add -N to only show each package to be installed one by line
ClosedPublic

Authored by bz on Nov 5 2024, 12:05 AM.
Tags
None
Referenced Files
F106166930: D47445.diff
Thu, Dec 26, 12:00 PM
Unknown Object (File)
Sat, Dec 21, 4:35 PM
Unknown Object (File)
Sat, Dec 21, 4:16 PM
Unknown Object (File)
Mon, Dec 2, 8:57 AM
Unknown Object (File)
Mon, Dec 2, 8:56 AM
Unknown Object (File)
Sat, Nov 30, 10:38 AM
Unknown Object (File)
Tue, Nov 26, 11:28 PM
Unknown Object (File)
Nov 24 2024, 10:16 AM
Subscribers

Details

Summary

pkg-install(8) currently has no option to allow skipping unavail
packages but it will just fail.
We would realy want to try to install as much firmware as found and
possible from the installer.
We work around this by doing one firmware package at a time.
For that it is highly helpful to be able to query (or possibly re-query)
all outstanding fimrware packages in an easily parseable way.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Nov 5 2024, 12:05 AM
manu requested changes to this revision.Nov 5 2024, 7:11 AM

Maybe it would be better to add a -q (quiet mode) as other tools often have ?
so -nq would behave like your -N but we could use -q for other futur things.

This revision now requires changes to proceed.Nov 5 2024, 7:11 AM

What would you do with -q in the non-'-n' case? Also not print the echos in line (old/new) 115/131 and 120/136 or just leave as-is for now?

In D47445#1082183, @bz wrote:

What would you do with -q in the non-'-n' case? Also not print the echos in line (old/new) 115/131 and 120/136 or just leave as-is for now?

Yeah I guess so, usually -q doesn't print anything not intended to be a result.

@manu I tried and also switched to getopts.

fwget: add -q for quiet output

Introduce -q to quieten other output (unless -v is also given).

pkg-install(8) currently has no option to allow skipping unavail
packages but it will just fail.
We would realy want to try to install as much firmware found as
possible from the installer.
Work around this by doing one firmware package at a time.
For that it is highly helpful to be able to query (or possibly re-query)
all outstanding fimrware packages.
-q together with -n only shows each package to be installed one by line.

While here switch to getopts so -qn works and not just -q -n.
bz planned changes to this revision.Nov 6 2024, 9:12 PM
bz added inline comments.
usr.sbin/fwget/fwget.sh
133

remove "" otherwise multi-pkg show up as one long line

This revision is now accepted and ready to land.Nov 7 2024, 6:29 AM

Just leaving this here as this would render some of this logic unneeded (also installer later): https://github.com/freebsd/pkg/issues/2195

This revision was automatically updated to reflect the committed changes.