summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2021-08-28 18:08:15 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2021-08-28 22:21:35 +0200
commite267d1ee54e3e2a9478201192293f3f8c72e118c (patch)
tree040229ac25490ef97e3d25339968b5cbf32534a7
parent255ec5a46aa55ad96e7dc7f9d43d5cdf71627812 (diff)
Inhibit autoremove calculation in apt-mark and apt show
As we never display the information in these code paths there isn't a lot of point in calculating it first saving us some precious CPU cycles. References: d6f3458badf2cfea3ca7de7632ae31daff5742be
-rw-r--r--apt-private/private-show.cc1
-rw-r--r--cmdline/apt-mark.cc4
2 files changed, 5 insertions, 0 deletions
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index 30b99b013..07b5a3ae3 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -300,6 +300,7 @@ static bool DisplayRecordV2(pkgCacheFile &CacheFile, pkgRecords &Recs, /*{{{*/
bool ShowPackage(CommandLine &CmdL) /*{{{*/
{
pkgCacheFile CacheFile;
+ CacheFile.InhibitActionGroups(true);
auto VolatileCmdL = GetAllPackagesAsPseudo(CacheFile.GetSourceList(), CmdL, AddVolatileBinaryFile, "");
if (unlikely(CacheFile.GetPkgCache() == nullptr))
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index 92efa0c81..3dd5ce784 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -47,6 +47,7 @@ using namespace std;
static bool DoAuto(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
+ CacheFile.InhibitActionGroups(true);
pkgDepCache * const DepCache = CacheFile.GetDepCache();
if (unlikely(DepCache == nullptr))
return false;
@@ -105,6 +106,7 @@ static bool DoAuto(CommandLine &CmdL)
static bool DoMarkAuto(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
+ CacheFile.InhibitActionGroups(true);
pkgDepCache * const DepCache = CacheFile.GetDepCache();
if (unlikely(DepCache == nullptr))
return false;
@@ -262,6 +264,7 @@ static bool DoMinimize(CommandLine &CmdL)
static bool ShowAuto(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
+ CacheFile.InhibitActionGroups(true);
pkgDepCache * const DepCache = CacheFile.GetDepCache();
if (unlikely(DepCache == nullptr))
return false;
@@ -301,6 +304,7 @@ static bool ShowAuto(CommandLine &CmdL)
static bool DoSelection(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
+ CacheFile.InhibitActionGroups(true);
pkgCache * const Cache = CacheFile.GetPkgCache();
if (unlikely(Cache == nullptr))
return false;