Page MenuHomeFreeBSD

Fix freebsd-update(8) erroneous message and exit status when "fetch install" used
ClosedPublic

Authored by ygy on Aug 15 2017, 6:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 8:50 PM
Unknown Object (File)
Oct 19 2024, 8:19 PM
Unknown Object (File)
Oct 19 2024, 8:19 PM
Unknown Object (File)
Oct 19 2024, 8:14 PM
Unknown Object (File)
Oct 19 2024, 8:14 PM
Unknown Object (File)
Oct 19 2024, 8:02 PM
Unknown Object (File)
Oct 16 2024, 2:07 PM
Unknown Object (File)
Oct 1 2024, 2:43 PM
Subscribers

Details

Summary

freebsd-update(8) allows chained commands, thus when running "fetch install" and fetch returns 0 with nothing to update, install will fail and the whole command returns 1.

This patch:

  • Change the status code to 0 when "freebsd-update install" has nothing to install (aka "Successfully installed nothing")
  • Omit the error message "Run '/usr/sbin/freebsd-update fetch' first." of "install" if "fetch" was run in the same command.

This closes PR190660.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.sbin/freebsd-update/freebsd-update.sh
786 ↗(On Diff #32095)

won't think fork '/bin/true' and use the return value? rather than the literal value "true"?

usr.sbin/freebsd-update/freebsd-update.sh
786 ↗(On Diff #32095)

I think the no-bracket true here will be attempted to parse as a builtin command or /bin/true but a literal value, but I am not completely sure.

I think it makes more sense to treat it like $NOTTYOK etc, and just make it 0 or 1

ygy marked 2 inline comments as done.

Hopefully Colin can get a chance to look at this too, but looks good to me now.

This revision is now accepted and ready to land.Aug 18 2017, 3:46 PM
ygy requested review of this revision.Sep 22 2017, 8:21 AM
This revision is now accepted and ready to land.Oct 2 2017, 5:43 PM

@emaste Can I commit it myself?

PR: 190660
Reviewed by: allanjude
Approved by: emaste
Differential_Revision: https://reviews.freebsd.org/D12037

In D12037#260784, @ygy wrote:

@emaste Can I commit it myself?

PR: 190660
Reviewed by: allanjude
Approved by: emaste
Differential_Revision: https://reviews.freebsd.org/D12037

Yes, go ahead (for reference, we've already discussed these non-doc commits with @ygy's mentor).

This revision was automatically updated to reflect the committed changes.