Page MenuHomeFreeBSD

freebsd-update: Fix src component detection
ClosedPublic

Authored by grembo on Sep 9 2019, 10:39 PM.
Tags
None
Referenced Files
F82119228: D21579.id.diff
Thu, Apr 25, 5:31 PM
F82098670: D21579.id62307.diff
Thu, Apr 25, 12:12 PM
Unknown Object (File)
Tue, Apr 23, 9:30 PM
Unknown Object (File)
Feb 23 2024, 11:20 PM
Unknown Object (File)
Feb 23 2024, 5:50 AM
Unknown Object (File)
Feb 19 2024, 2:40 PM
Unknown Object (File)
Dec 11 2023, 2:06 AM
Unknown Object (File)
Nov 28 2023, 7:43 AM
Subscribers

Details

Summary

This was originally part of D21473. As that review also added new features, I separated it into its own review, hoping that this will speed up the review process and also allow a separate commit that could be MFCed.

D18849, commit rS343152, bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224048 aimed to fix freebsd-update's detection if the src component is installed.

Unfortunately this fix doesn't work, as freebsd-update's option calculation works differently.

  1. If BaseDir is configured in freebsd-update.conf, COMPONENTS is calculated first, so BASEDIR isn't set yet when used in config_Components
  2. If BaseDir is specified on the command line (-b), it's moved to BASEDIR_saved before parsing the configuration file, so again, it's not available when used in config_Components

The cleanest fix seemed to add an additional function that's called after parsing all inputs and check if "src" needs to be removed.

The result of this problem is that the existence of /usr/src/COPYRIGHT determines if the src components should be updated or not, leading to not updating it or error messages as it isn't around. This is a common problem for certain jail setups (I noticed it while upgrading an iocage jail).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26567
Build 24955: arc lint + arc unit

Event Timeline

Fine with me, although I'd prefer a different name for config_Components_src. This is not directly used for the config file as other config_-prefixed functions are. Maybe something like filter_components?

This revision is now accepted and ready to land.Sep 19 2019, 11:21 AM

Yeah, that's a good point. Also "config_Components_src" would get called if someone has a line in freebsd-update.conf starting with "Components_src" which is not what we want (it should be an error).

Change function name to make more sense.

This revision now requires review to proceed.Sep 19 2019, 11:45 AM

Fine with me, although I'd prefer a different name for config_Components_src. This is not directly used for the config file as other config_-prefixed functions are. Maybe something like filter_components?

Good point. As there is quite a lot of filtering going on already (functionally as well as in terms of naming) I changed it to `finalize_components_config' now, does this work for you?

This revision is now accepted and ready to land.Sep 19 2019, 12:00 PM
This revision was automatically updated to reflect the committed changes.