From 6675601c81de85b40dc89772c1d6d17f1811c5ba Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 5 Oct 2018 12:29:39 +0200 Subject: Set DPKG_FRONTEND_LOCKED when running {pre,post}-invoke scripts Some post-invoke scripts install packages, which fails because the environment variable is not set. This sets the variable for all three kinds of scripts {pre,post-}invoke and pre-install-pkgs, but we will only allow post-invoke at a later time. Gbp-Dch: full --- apt-pkg/contrib/fileutl.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 85d7b36c7..eab05de4f 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -101,6 +102,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 " -- cgit v1.2.3