diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-05-03 19:19:22 +0100 |
---|---|---|
committer | Lyndon Brown <jnqnfe@gmail.com> | 2020-05-03 22:19:43 +0100 |
commit | 6cf3321d8471046bbbe203fb3f18d6507c402024 (patch) | |
tree | a1db23ca5b10a69f55d86258cf061f60e942e33e /functions | |
parent | 23f02ec7eeeac790c247ba084b8755c3b718ff01 (diff) | |
download | vyos-live-build-6cf3321d8471046bbbe203fb3f18d6507c402024.tar.gz vyos-live-build-6cf3321d8471046bbbe203fb3f18d6507c402024.zip |
config: provide UTC timestamp control
`DATE_UTC_OPTION` is set in `Prepare_config()` for use by scripts, even
though only a few scripts will actually use it, since it allows those
scripts to be cleaner. we may want to possibly extend this as a
`DATE_OPTIONS` variable perhaps as part of enabling proper reproduciblity.
Gbp-Dch: Short
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/configuration.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/functions/configuration.sh b/functions/configuration.sh index 0793c0dc8..5bce6df5e 100755 --- a/functions/configuration.sh +++ b/functions/configuration.sh @@ -42,6 +42,14 @@ Prepare_config () LB_DISTRIBUTION_CHROOT="${LB_DISTRIBUTION_CHROOT:-${LB_DISTRIBUTION}}" LB_DISTRIBUTION_BINARY="${LB_DISTRIBUTION_BINARY:-${LB_DISTRIBUTION_CHROOT}}" + LB_UTC_TIME="${LB_UTC_TIME:-false}" + # Set UTC option for use with `date` where applicable + if [ "${LB_UTC_TIME}" = "true" ]; then + DATE_UTC_OPTION="--utc" + else + DATE_UTC_OPTION="" + fi + LB_IMAGE_NAME="${LB_IMAGE_NAME:-live-image}" LB_IMAGE_TYPE="${LB_IMAGE_TYPE:-iso-hybrid}" #for backwards compatibility with hooks @@ -533,6 +541,10 @@ Validate_config_permitted_values () Echo_error "Value for LB_UPDATES (--updates) can only be 'true' or 'false'!" exit 1 fi + if [ "${LB_UTC_TIME}" != "true" ] && [ "${LB_UTC_TIME}" != "false" ]; then + Echo_error "Value for LB_UTC_TIME (--utc-time) can only be 'true' or 'false'!" + exit 1 + fi if [ "${LB_WIN32_LOADER}" != "true" ] && [ "${LB_WIN32_LOADER}" != "false" ]; then Echo_error "Value for LB_WIN32_LOADER (--win32-loader) can only be 'true' or 'false'!" exit 1 |