summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
authorNicolas Schier <nicolas@fjasle.eu>2020-02-27 05:04:54 +0100
committerNicolas Schier <nicolas@fjasle.eu>2020-06-08 12:18:33 +0200
commitc19a3276fe7ecfc132e95b0277e9e68ff364dd92 (patch)
treeeb4b99eaa2790626969cc7623fda9e7acdbf6c14 /apt-pkg/depcache.cc
parent83b239c7285ac7450e305643b29596396abc0b3f (diff)
Support marking all newly installed packages as automatically installed
Add option '--mark-auto' to 'apt install' that marks all newly installed packages as automatically installed. Signed-off-by: Nicolas Schier <nicolas@fjasle.eu>
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 2eac1ba41..f90a41e22 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1156,6 +1156,7 @@ struct CompareProviders /*{{{*/
/*}}}*/
bool pkgDepCache::MarkInstall_StateChange(pkgCache::PkgIterator const &Pkg, bool AutoInst, bool FromUser) /*{{{*/
{
+ bool AlwaysMarkAsAuto = _config->FindB("APT::Get::Mark-Auto", false) == true;
auto &P = (*this)[Pkg];
if (P.Protect() && P.InstallVer == P.CandidateVer)
return true;
@@ -1171,7 +1172,7 @@ bool pkgDepCache::MarkInstall_StateChange(pkgCache::PkgIterator const &Pkg, bool
P.Mode = pkgDepCache::ModeInstall;
P.InstallVer = P.CandidateVer;
- if(FromUser)
+ if(FromUser && !AlwaysMarkAsAuto)
{
// Set it to manual if it's a new install or already installed,
// but only if its not marked by the autoremover (aptitude depend on this behavior)