From a7dfc32efc6ae4780e25ffc4fce3e59588926e16 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 13 Feb 2019 14:02:12 +0100 Subject: 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) (cherry picked from commit 60a0770538b8c1603ace4293bb76c426692a953a) --- apt-private/private-install.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 107ed398e..64ab3d72a 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -47,6 +47,8 @@ class pkgSourceList; 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(); @@ -83,7 +85,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) @@ -368,6 +370,9 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) "all files have been overwritten by other packages:", disappearedPkgs.size()), disappear, ""); c0out << _("Note: This is done automatically and on purpose by dpkg.") << std::endl; + if (not RunScripts("APT::Install::Post-Invoke-Success")) + return false; + return true; } /*}}}*/ -- cgit v1.2.3