summaryrefslogtreecommitdiffstats
path: root/apt-private/private-output.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-23 04:10:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-23 04:10:50 +0000
commitfaf78e24948280b25ccad71e5fe027809f8c6279 (patch)
treeeac8c502171ec9b3295e1ed84791d63a2f567666 /apt-private/private-output.h
parentAdding upstream version 2.9.1. (diff)
downloadapt-faf78e24948280b25ccad71e5fe027809f8c6279.tar.xz
apt-faf78e24948280b25ccad71e5fe027809f8c6279.zip
Adding upstream version 2.9.2.upstream/2.9.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-private/private-output.h')
-rw-r--r--apt-private/private-output.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/apt-private/private-output.h b/apt-private/private-output.h
index 4cc7c01..0eba6f4 100644
--- a/apt-private/private-output.h
+++ b/apt-private/private-output.h
@@ -1,6 +1,7 @@
#ifndef APT_PRIVATE_OUTPUT_H
#define APT_PRIVATE_OUTPUT_H
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/macros.h>
@@ -18,7 +19,6 @@ class CacheFile;
class pkgDepCache;
class pkgRecords;
-
APT_PUBLIC extern std::ostream c0out;
APT_PUBLIC extern std::ostream c1out;
APT_PUBLIC extern std::ostream c2out;
@@ -43,7 +43,8 @@ template<class Container, class PredicateC, class DisplayP, class DisplayV> bool
PredicateC Predicate,
DisplayP PkgDisplay,
DisplayV VerboseDisplay,
- std::string colorName = "APT::Color::Neutral")
+ std::string colorName = "",
+ std::string Note = "")
{
size_t const ScreenWidth = (::ScreenWidth > 3) ? ::ScreenWidth - 3 : 0;
int ScreenUsed = 0;
@@ -52,8 +53,8 @@ template<class Container, class PredicateC, class DisplayP, class DisplayV> bool
bool printedTitle = false;
std::vector<std::string> PackageList;
- auto setColor = _config->FindI("APT::Output-Version") >= 30 ? _config->Find(colorName) : "";
- auto resetColor = _config->FindI("APT::Output-Version") >= 30 ? _config->Find("APT::Color::Neutral") : "";
+ auto setColor = APT::Configuration::color(colorName);
+ auto resetColor = not setColor.empty() ? APT::Configuration::color("neutral") : "";
for (auto const &Pkg: cont)
{
@@ -105,6 +106,8 @@ template<class Container, class PredicateC, class DisplayP, class DisplayV> bool
ShowWithColumns(out, PackageList, 2, ScreenWidth);
out << resetColor;
}
+ if (not Note.empty())
+ out << Note << std::endl;
if (_config->FindI("APT::Output-Version") >= 30)
out << std::endl;
return false;