diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2024-04-19 16:12:42 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-04-19 16:58:24 +0200 |
commit | dc779ff0a33d9da8bc55390ee55ad73d31739e46 (patch) | |
tree | 50ae95db9686cc39d0ffc6b840ebea0da5383d59 /apt-private | |
parent | e07450beb5a474ec3c099ff3eb329892b040d04c (diff) |
Configure individual action colors using APT::Color::Action
Diffstat (limited to 'apt-private')
-rw-r--r-- | apt-private/private-install.cc | 2 | ||||
-rw-r--r-- | apt-private/private-output.cc | 18 |
2 files changed, 13 insertions, 7 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 87793d973..774c03d0a 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -1104,7 +1104,7 @@ bool DoInstall(CommandLine &CmdL) if (_config->FindI("APT::Output-Version") < 30 && Cache->InstCount() != verset[MOD_INSTALL].size()) ShowList(c1out, _("The following additional packages will be installed:"), Universe, PkgIsExtraInstalled(&Cache, &verset[MOD_INSTALL]), - &PrettyFullName, CandidateVersion(&Cache), "green"); + &PrettyFullName, CandidateVersion(&Cache), "action::install-dependencies"); /* Print out a list of suggested and recommended packages */ if (_config->FindI("APT::Output-Version") < 30) diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc index 380558964..c2e936d2c 100644 --- a/apt-private/private-output.cc +++ b/apt-private/private-output.cc @@ -105,6 +105,12 @@ bool InitOutput(std::basic_streambuf<char> * const out) /*{{{*/ _config->CndSet("APT::Color::Magenta", "\x1B[35m"); _config->CndSet("APT::Color::Cyan", "\x1B[36m"); _config->CndSet("APT::Color::White", "\x1B[37m"); + + _config->CndSet("APT::Color::Action::Upgrade", "green"); + _config->CndSet("APT::Color::Action::Install", "green"); + _config->CndSet("APT::Color::Action::Install-Dependencies", "green"); + _config->CndSet("APT::Color::Action::Downgrade", "yellow"); + _config->CndSet("APT::Color::Action::Remove", "red"); } return true; @@ -557,7 +563,7 @@ void ShowNew(ostream &out,CacheFile &Cache) [&Cache](pkgCache::PkgIterator const &Pkg) { return Cache[Pkg].NewInstall(); }, &PrettyFullName, CandidateVersion(&Cache), - "green"); + "action::install"); return; } @@ -565,12 +571,12 @@ void ShowNew(ostream &out,CacheFile &Cache) [&Cache](pkgCache::PkgIterator const &Pkg) { return Cache[Pkg].NewInstall() && (Cache[Pkg].Flags & pkgCache::Flag::Auto) == 0; }, &PrettyFullName, CandidateVersion(&Cache), - "green"); + "action::install"); ShowList(out,_("Installing dependencies:"), Universe, [&Cache](pkgCache::PkgIterator const &Pkg) { return Cache[Pkg].NewInstall() && Cache[Pkg].Flags & pkgCache::Flag::Auto;}, &PrettyFullName, CandidateVersion(&Cache), - "green"); + "action::install-dependencies"); } /*}}}*/ // ShowDel - Show packages to delete /*{{{*/ @@ -588,7 +594,7 @@ void ShowDel(ostream &out,CacheFile &Cache) return str; }, CandidateVersion(&Cache), - "red"); + "action::remove"); } /*}}}*/ // ShowPhasing - Show packages kept due to phasing /*{{{*/ @@ -627,7 +633,7 @@ void ShowUpgraded(ostream &out,CacheFile &Cache) }, &PrettyFullName, CurrentToCandidateVersion(&Cache), - "green"); + "action::upgrade"); } /*}}}*/ // ShowDowngraded - Show downgraded packages /*{{{*/ @@ -644,7 +650,7 @@ bool ShowDowngraded(ostream &out,CacheFile &Cache) }, &PrettyFullName, CurrentToCandidateVersion(&Cache), - "yellow"); + "action::downgrade"); } /*}}}*/ // ShowHold - Show held but changed packages /*{{{*/ |