client: src: lib_gen: filter container config .in files

Adds filters to remove noisy license clutter in configuration output.

This is needed because of the amount of `edit` used on configurations.

The license still applies, regardless.
This commit is contained in:
2024-09-24 19:33:46 -07:00
parent f18bd9aabb
commit 4a836a77c4

View File

@@ -580,7 +580,11 @@ function lib_gen::__gen_superscript_write()
[ -z "$global_superscript" ] && lib_utils::die_fatal
lib_utils::print_debug "global_superscript=${global_superscript}"
# Filter to de-clutter output file (license cleanup)
local -r _filter="3,19d"
sed \
-e "$_filter" \
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
"${global_repo_conf_dir}/container/shell/superscript.bash.in" >"$global_superscript"
}
@@ -846,7 +850,11 @@ function lib_gen::__gen_subprofile_flow_subscript_write()
[ -z "$global_client_version" ] && lib_utils::die_fatal
[ -z "$global_repo_conf_dir" ] && lib_utils::die_fatal
# Filter to de-clutter output file (license cleanup)
local -r _filter="3,19d"
sed \
-e "$_filter" \
-e "s:@DOCKER_FINANCE_CONTAINER_CMD@:${DOCKER_FINANCE_CONTAINER_CMD}:g" \
-e "s:@DOCKER_FINANCE_CONTAINER_REPO@:${DOCKER_FINANCE_CONTAINER_REPO}:g" \
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
@@ -917,7 +925,11 @@ function lib_gen::__gen_subprofile_flow_fetch_write()
[ -z "$global_client_version" ] && lib_utils::die_fatal
[ -z "$global_repo_conf_dir" ] && lib_utils::die_fatal
# Filter to de-clutter output file (license cleanup)
local -r _filter="1,17d"
sed \
-e "$_filter" \
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
-e "s:@DOCKER_FINANCE_PROFILE@:${_profile}:g" \
-e "s:@DOCKER_FINANCE_SUBPROFILE@:${_subprofile}:g" \
@@ -965,6 +977,7 @@ function lib_gen::__gen_subprofile_flow_meta_write()
[ -z "$global_repo_conf_dir" ] && lib_utils::die_fatal
# Deletes default comments or else ROOT meta sample won't work out-of-the-box
# TODO: possible to keep filtered comments using upstream options?
sed \
-e "/\/\/\\!/d" \
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
@@ -1013,7 +1026,11 @@ function lib_gen::__gen_subprofile_flow_hledger_write()
[ -z "$global_repo_conf_dir" ] && lib_utils::die_fatal
lib_utils::print_debug "global_repo_conf_dir=${global_repo_conf_dir}"
# Filter to de-clutter output file (license cleanup)
local -r _filter="1,17d"
sed \
-e "$_filter" \
-e "s:@DOCKER_FINANCE_VERSION@:${global_client_version}:g" \
"${global_repo_conf_dir}/container/hledger/hledger.conf.in" >"$_file"
}