summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-28 16:46:16 +0000
committerRaphaƫl Hertzog <hertzog@debian.org>2020-04-23 15:52:32 +0200
commitf4c8a28a21e7edd50f01dec7450fefad4da07714 (patch)
treed0da6da0b4400b99a0a483302bdc8b793159ccc8
parentfaa51b83c5c46611c856b13064b0087b8999de4c (diff)
downloadvyos-live-build-f4c8a28a21e7edd50f01dec7450fefad4da07714.tar.gz
vyos-live-build-f4c8a28a21e7edd50f01dec7450fefad4da07714.zip
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
-rwxr-xr-xfunctions/configuration.sh9
-rwxr-xr-xfunctions/init.sh10
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.