summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/fileutl.cc3
-rw-r--r--apt-pkg/deb/dpkgpm.cc3
2 files changed, 6 insertions, 0 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index b53277577..5d283bdf5 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -26,6 +26,7 @@
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgsystem.h>
#include <ctype.h>
#include <stdarg.h>
@@ -97,6 +98,8 @@ bool RunScripts(const char *Cnf)
// This is the child
if (Child == 0)
{
+ if (_system != nullptr && _system->IsLocked() == true && (stringcasecmp(Cnf, "dpkg::post-invoke") == 0 || stringcasecmp(Cnf, "dpkg::pre-invoke") == 0))
+ setenv("DPKG_FRONTEND_LOCKED", "true", 1);
if (_config->FindDir("DPkg::Chroot-Directory","/") != "/")
{
std::cerr << "Chrooting into "
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 37452f3d3..7a3d1d1f4 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -467,6 +467,9 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
strprintf(hookfd, "%d", InfoFD);
setenv("APT_HOOK_INFO_FD", hookfd.c_str(), 1);
+ if (_system != nullptr && _system->IsLocked() == true && stringcasecmp(Cnf, "DPkg::Pre-Install-Pkgs") == 0)
+ setenv("DPKG_FRONTEND_LOCKED", "true", 1);
+
debSystem::DpkgChrootDirectory();
const char *Args[4];
Args[0] = "/bin/sh";