From f4c8a28a21e7edd50f01dec7450fefad4da07714 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Sat, 28 Mar 2020 16:46:16 +0000 Subject: config: move control of apt colour being done in Prepare_config() meant that it would get saved into the config stored on disk which is not what was intended. being saved on disk is not a big problem, since the injection of the dynamically determined option is always done on top of the value read from the saved config anyway, so you'd always end up with two copies of the option given to apt, the first being from the saved config, the second being the more correct dynamically determined one, overriding the first. so there is no functional change here, just better achieving what was intended. Gbp-Dch: Ignore --- functions/configuration.sh | 9 --------- functions/init.sh | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/functions/configuration.sh b/functions/configuration.sh index c0c39f250..5c226d4d3 100755 --- a/functions/configuration.sh +++ b/functions/configuration.sh @@ -133,15 +133,6 @@ Prepare_config () APT_OPTIONS="${APT_OPTIONS:---yes}" APTITUDE_OPTIONS="${APTITUDE_OPTIONS:---assume-yes}" - # Apt v2.0.1 introduced color support, but it needs to be explicitly enabled - if [ "${_COLOR_OUT}" = "true" ] && [ "${_COLOR_ERR}" = "true" ]; then - APT_OPTIONS="${APT_OPTIONS} -o APT::Color=true" - APTITUDE_OPTIONS="${APTITUDE_OPTIONS} -o APT::Color=true" - else - APT_OPTIONS="${APT_OPTIONS} -o APT::Color=false" - APTITUDE_OPTIONS="${APTITUDE_OPTIONS} -o APT::Color=false" - fi - BZIP2_OPTIONS="${BZIP2_OPTIONS:--6}" GZIP_OPTIONS="${GZIP_OPTIONS:--6}" LZIP_OPTIONS="${LZIP_OPTIONS:--6}" diff --git a/functions/init.sh b/functions/init.sh index c050b495b..1fbbd9308 100755 --- a/functions/init.sh +++ b/functions/init.sh @@ -29,6 +29,16 @@ Init_config_data () Read_conffiles $(Common_config_files) Prepare_config + + # Apt v2.0.1 introduced color support, but it needs to be explicitly enabled. + # This is done here so that the injection of the option does not get stored in the config file. + if [ "${_COLOR_OUT}" = "true" ] && [ "${_COLOR_ERR}" = "true" ]; then + APT_OPTIONS="${APT_OPTIONS} -o APT::Color=true" + APTITUDE_OPTIONS="${APTITUDE_OPTIONS} -o APT::Color=true" + else + APT_OPTIONS="${APT_OPTIONS} -o APT::Color=false" + APTITUDE_OPTIONS="${APTITUDE_OPTIONS} -o APT::Color=false" + fi } # "Auto" script redirection. -- cgit v1.2.3