summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-02-13 14:02:12 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2019-02-18 14:04:09 +0100
commitd570765ea4952a503c1a6531ac5de89259f06b33 (patch)
treea2ac16394905f3fe6a74f7f666d8b27de45bf7d2
parent8bc7f7e522921beedda6aeab13330a17b339451d (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)
-rw-r--r--apt-private/private-install.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 041acce0e..d2fb332af 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -103,6 +103,8 @@ static void RemoveDownloadNeedingItemsFromFetcher(pkgAcquire &Fetcher, bool &Tra
}
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)
for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() == false; ++I)
if (Cache[I].Delete() == true && Cache[I].Purge() == false)
@@ -178,7 +180,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;
}
/*}}}*/