diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-02-13 14:02:12 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-03-01 10:04:22 +0100 |
commit | 8f256d2f4fb6885de6aa1595eef08acf6f0d4dce (patch) | |
tree | 910c3df5c55818395ed30d6fa674b23d2fa9a37a | |
parent | 51a4fef1a32ebbd157ba04347e25afa7df6f81ce (diff) |
Introduce APT::Install::Pre-Invoke / Post-Invoke-Success
These will run in our frontends currently, and can show
messages. For the sake of keeping the implementation
complexity low, a non-success variant of Post-Invoke
is not provided.
LP: #1815761
(cherry picked from commit 3f3cad74c2abbe3837fa98030c703dd4f5f191dc)
(cherry picked from commit b93802c2a30e60d7a21b309fd0724be8ac2a2d78)
(cherry picked from commit d570765ea4952a503c1a6531ac5de89259f06b33)
-rw-r--r-- | apt-private/private-install.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 356d1cd36..0494ed3b0 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -79,6 +79,8 @@ bool CheckNothingBroken(CacheFile &Cache) /*{{{*/ happen and then calls the download routines */ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) { + if (not RunScripts("APT::Install::Pre-Invoke")) + return false; if (_config->FindB("APT::Get::Purge",false) == true) { pkgCache::PkgIterator I = Cache->PkgBegin(); @@ -120,7 +122,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) if (Cache->DelCount() == 0 && Cache->InstCount() == 0 && Cache->BadCount() == 0) - return true; + return RunScripts("APT::Install::Post-Invoke-Success"); // No remove flag if (Cache->DelCount() != 0 && _config->FindB("APT::Get::Remove",true) == false) @@ -392,6 +394,9 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) } } + if (not RunScripts("APT::Install::Post-Invoke-Success")) + return false; + return true; } /*}}}*/ |