summaryrefslogtreecommitdiffstats
path: root/apt-private/private-show.cc
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-show.cc
parentAdding upstream version 2.9.1. (diff)
downloadapt-upstream/2.9.2.tar.xz
apt-upstream/2.9.2.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-show.cc')
-rw-r--r--apt-private/private-show.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index cefbd9b..4ae0430 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -1,6 +1,7 @@
// Includes /*{{{*/
#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/cmndline.h>
@@ -33,6 +34,8 @@
#include <apti18n.h>
/*}}}*/
+using APT::Configuration::color;
+
pkgRecords::Parser &LookupParser(pkgRecords &Recs, pkgCache::VerIterator const &V, pkgCache::VerFileIterator &Vf) /*{{{*/
{
Vf = V.FileList();
@@ -271,7 +274,8 @@ static bool DisplayRecordV2(pkgCacheFile &CacheFile, pkgRecords &Recs, /*{{{*/
RW.push_back(pkgTagSection::Tag::Remove("Description"));
RW.push_back(pkgTagSection::Tag::Remove("Description-md5"));
// improve
- RW.push_back(pkgTagSection::Tag::Rewrite("Package", V.ParentPkg().FullName(true)));
+ RW.push_back(pkgTagSection::Tag::Rewrite("Package", color("Show::Package", V.ParentPkg().FullName(true))));
+
RW.push_back(pkgTagSection::Tag::Rewrite("Installed-Size", installed_size));
RW.push_back(pkgTagSection::Tag::Remove("Size"));
RW.push_back(pkgTagSection::Tag::Rewrite("Download-Size", package_size));
@@ -282,7 +286,7 @@ static bool DisplayRecordV2(pkgCacheFile &CacheFile, pkgRecords &Recs, /*{{{*/
FileFd stdoutfd;
if (stdoutfd.OpenDescriptor(STDOUT_FILENO, FileFd::WriteOnly, false) == false ||
- Tags.Write(stdoutfd, TFRewritePackageOrder, RW) == false || stdoutfd.Close() == false)
+ Tags.Write(stdoutfd, pkgTagSection::WRITE_HUMAN, TFRewritePackageOrder, RW) == false || stdoutfd.Close() == false)
return _error->Error("Internal Error, Unable to parse a package record");
// write the description
@@ -291,7 +295,7 @@ static bool DisplayRecordV2(pkgCacheFile &CacheFile, pkgRecords &Recs, /*{{{*/
if (Desc.end() == false)
{
pkgRecords::Parser &P = Recs.Lookup(Desc.FileList());
- out << "Description: " << P.LongDesc();
+ out << color("Show::Field", "Description: ") << P.LongDesc();
}
// write a final newline (after the description)