Page MenuHomeFreeBSD

pkg(7): improve error message
ClosedPublic

Authored by emaste on Oct 7 2024, 3:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 9:06 AM
Unknown Object (File)
Tue, Nov 19, 6:01 PM
Unknown Object (File)
Tue, Nov 19, 6:49 AM
Unknown Object (File)
Sun, Nov 17, 4:19 PM
Unknown Object (File)
Fri, Nov 15, 2:55 PM
Unknown Object (File)
Wed, Nov 6, 12:16 PM
Unknown Object (File)
Tue, Nov 5, 1:36 PM
Unknown Object (File)
Wed, Oct 30, 8:14 AM
Subscribers

Diff Detail

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

Event Timeline

bapt requested review of this revision.Oct 7 2024, 3:47 PM
0mp added inline comments.
usr.sbin/pkg/pkg.c
860

Am I reading it wrong or j is not used anywhere inside the loop?

bapt marked an inline comment as done.Oct 7 2024, 4:05 PM
usr.sbin/pkg/pkg.c
860

Yes this is a bug. It's also possible that the two entries failed for different reasons, and fetchLastErrString does not apply to the first.

bapt marked an inline comment as done.Oct 7 2024, 4:26 PM

there are good chances they do apply ;)

usr.sbin/pkg/pkg.c
860

yes the error might be different but the chances they are the same are imho good enough for now.

usr.sbin/pkg/pkg.c
860

Yes fair enough, they are probably the same. If we wanted to be precise we could emit:

Attempted to fetch ....
Attempted to fetch ...
Error: ...
emaste updated this revision to Diff 144416.
emaste edited reviewers, added: bapt; removed: emaste.

print one error message at end

Sample output:

The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: yes
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:15:amd64/latest, please wait...
pkg: Attempted to fetch http://pkg.FreeBSD.org/FreeBSD:15:amd64/latest/Latest/pkg.pkg
pkg: Attempted to fetch http://pkg.FreeBSD.org/FreeBSD:15:amd64/latest/Latest/pkg.txz
pkg: Error: Host does not resolve
Address resolution failed for http://pkg.FreeBSD.org/FreeBSD:15:amd64/latest.
Consider changing PACKAGESITE.
This revision was not accepted when it landed; it landed in state Needs Review.Oct 7 2024, 5:06 PM
This revision was automatically updated to reflect the committed changes.