Page MenuHomeFreeBSD

release.sh: allow GITROOT, etc, to be overridden
Needs ReviewPublic

Authored by ngie on Fri, Dec 26, 5:48 PM.
Tags
None
Referenced Files
F141885951: D54374.diff
Mon, Jan 12, 12:18 AM
Unknown Object (File)
Sat, Jan 10, 8:11 PM
Unknown Object (File)
Fri, Jan 9, 10:26 PM
Unknown Object (File)
Thu, Jan 8, 12:28 AM
Unknown Object (File)
Wed, Jan 7, 1:38 AM
Unknown Object (File)
Tue, Jan 6, 12:34 PM
Unknown Object (File)
Sat, Jan 3, 8:28 AM
Unknown Object (File)
Sat, Jan 3, 7:04 AM

Details

Reviewers
cperciva
Summary

release(7) claims that the various variables, e.g., GITROOT, etc, can
be overridden in config files, but unfortunately that's not true (the
values remained whatever default they were hardcoded to in the script).

This change allows the following variables to be overridden in config
files, permitting the release process to be customizable.

Test Plan

This change allowed me to do the following in a config file:

SRCCONF="$(dirname "$0")/src.conf"
GITROOT="file:///home/ngie/git/"
GITSRC="freebsd-src"
GITPORTS="freebsd-ports"

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69479
Build 66362: arc lint + arc unit

Event Timeline

ngie requested review of this revision.Fri, Dec 26, 5:48 PM
ngie added a reviewer: cperciva.
ngie added a subscriber: releng.

Hmm, I thought the way this worked was that env_setup set defaults and then the config file was sourced to override those values.

Hmm, I thought the way this worked was that env_setup set defaults and then the config file was sourced to override those values.

There's no way to just redefine some of the values in a custom conf file (the conf definition of env_setup would shadow the release.sh provided definition), so instead you end up having to fork the entire function to tweak the behavior for a few variables.

It seems like env_setup should be named default_env_setup and env_setup should be a no-op function that allows others to override the values. I would be game for doing that instead since that would be a lot cleaner/easier to document in release(7).

Ok, I'm going to have to refresh my memory of how these bits work.