Page MenuHomeFreeBSD

pkg(7): improve error message
ClosedPublic

Authored by emaste on Mon, Oct 7, 3:47 PM.

Details

Summary

Print the complete list of url that have failed

Diff Detail

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

Event Timeline

bapt requested review of this revision.Mon, Oct 7, 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.Mon, Oct 7, 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.Mon, Oct 7, 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.Mon, Oct 7, 5:06 PM
This revision was automatically updated to reflect the committed changes.