Created attachment 206735 [details] Patch to introduce new environment variable SKIPISFETCHEDCHECK In bug #229346 freebsd-update was changed to fix ezjail and iocell ugrades. Unfortunately this also broke iocage's upgrade mechanism. This patch introduces an environment variable to control the behavior of the check in question. By setting SKIPISFETCHEDCHECK, the test if there was a fetch phase before running install is skipped, therefore not showing an error message (which confuses the user in automatic setups anyway) and avoiding exiting with an error code, which broke iocage. See also: https://github.com/iocage/iocage/pull/1027
Is there any reason that iocage shouldn't do a 'fetch' before install?
(In reply to Xin LI from comment #1) Yes, not everyone always runs "freebsd-update fetch install" in one command, but separately like in "freebsd-update fetch", "freebsd-update install"
After going back and forth and discussing with Colin, I implemented a better solution for iocage. While testing I noticed that detection of the src component didn't work if BASEPATH != "/" (even though there was an attempt to correct that earlier this year), so I fixed that. While there, I added new exit codes (instead of the original SKIPISFETCHEDCHECK solution) and two new commands (partially discussed OL). As freebsd-update is mission critical, I opened a code review for better collaboration on it: https://reviews.freebsd.org/D21473 (this sounds like a lot, but is relatively trivial in the end)
After splitting bugfix and feature parts in the review, I'm doing the same with the problem report.
(In reply to Michael Gmelin from comment #4) New feature Bug #240757
A commit references this bug: Author: grembo Date: Sun Sep 22 19:53:29 UTC 2019 New revision: 352608 URL: https://svnweb.freebsd.org/changeset/base/352608 Log: MFC r352542: freebsd-update: Fix src component detection PR: 224048, 238558, 239997 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D21579 Changes: _U stable/12/ stable/12/usr.sbin/freebsd-update/freebsd-update.sh
Typo in commit message. A commit references this bug: Author: grembo Date: Sun Sep 22 20:03:26 UTC 2019 New revision: 352610 URL: https://svnweb.freebsd.org/changeset/base/352610 Log: MFC r352542: freebsd-update: Fix src component detection PR: 224048, 238558, 23999 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D21579 Changes: _U stable/11/ stable/11/usr.sbin/freebsd-update/freebsd-update.sh
A commit references this bug: Author: grembo Date: Mon Sep 23 15:58:55 UTC 2019 New revision: 352628 URL: https://svnweb.freebsd.org/changeset/base/352628 Log: MF stable/12 r352608 Approved by: re (gjb) r352608: freebsd-update: Fix src component detection In case BASEDIR was set to a directory that differed from the default filesystem root, freebsd-update wrongly checked for the existence of /usr/src/COPYRIGHT to determine if the src component was installed. Existing code to address this wasn't effective due to the order in which configuration options were evaluated. PR: 224048, 238558, 239997 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D21579 Changes: _U releng/12.1/ releng/12.1/usr.sbin/freebsd-update/freebsd-update.sh