From ad24ea39b5dd0ce990a20a60b888511261ec21e1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 3 May 2016 14:11:30 +0200 Subject: let DPKG_COLORS default to our APT::Color setting dpkg can optionally colorize its output since 1.18.5. Currently this defaults to 'never', but it will eventually be 'auto'. It seems reasonable to assume that a user who has enabled/disabled colors in apt will want to have dpkg have the same state regarding color usage. This isn't overriding explicit settings by the user, so in case a user feels strongly about it one way or the other there are options. --- apt-pkg/deb/dpkgpm.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apt-pkg/deb/dpkgpm.cc') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 834cb0e25..76a81bb33 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1501,6 +1501,13 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) _exit(100); } + // if color support isn't enabled/disabled explicitly tell + // dpkg to use the same state apt is using for its color support + if (_config->FindB("APT::Color", false) == true) + setenv("DPKG_COLORS", "always", 0); + else + setenv("DPKG_COLORS", "never", 0); + execvp(Args[0], (char**) &Args[0]); cerr << "Could not exec dpkg!" << endl; _exit(100); -- cgit v1.2.3