summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-04-01 11:30:00 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-04-01 12:16:03 +0200
commite5b7e019232f89a97e8ba3cbffa295595daa0351 (patch)
tree41a84963fb19fc8bc6d9b73bd424390027e8fa8c
parent21b3eac8f9ab8e12b43fa8998a5aa5465f29adc5 (diff)
Add new Debug::RunScripts option
This debug option will display all scripts that are run by apts RunScripts and RunScriptsWithPkgs helpers.
-rw-r--r--apt-pkg/contrib/fileutl.cc6
-rw-r--r--apt-pkg/deb/dpkgpm.cc4
-rw-r--r--doc/apt.conf.5.xml12
-rw-r--r--doc/examples/configure-index2
4 files changed, 22 insertions, 2 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 69406a9bf..188bb87ee 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -104,7 +104,11 @@ bool RunScripts(const char *Cnf)
{
if (Opts->Value.empty() == true)
continue;
-
+
+ if(_config->FindB("Debug::RunScripts", false) == true)
+ std::clog << "Running external script: '"
+ << Opts->Value << "'" << std::endl;
+
if (system(Opts->Value.c_str()) != 0)
_exit(100+Count);
}
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 5a5fff13b..e68c2ca34 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -410,6 +410,10 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
if (Opts->Value.empty() == true)
continue;
+ if(_config->FindB("Debug::RunScripts", false) == true)
+ std::clog << "Running external script with list of all .deb file: '"
+ << Opts->Value << "'" << std::endl;
+
// Determine the protocol version
string OptSec = Opts->Value;
string::size_type Pos;
diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml
index 78f6a27a2..fcbf20dac 100644
--- a/doc/apt.conf.5.xml
+++ b/doc/apt.conf.5.xml
@@ -1184,6 +1184,18 @@ DPkg::TriggersPending "true";</literallayout></para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>Debug::RunScripts</option></term>
+ <listitem>
+ <para>
+ Display the external commands that are called by apt hooks.
+ This includes e.g. the config options
+ <literal>DPkg::{Pre,Post}-Invoke</literal> or
+ <literal>APT::Update::{Pre,Post}-Invoke</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
<!-- 2009/07/11 Currently used nowhere. The corresponding code
is commented.
<varlistentry>
diff --git a/doc/examples/configure-index b/doc/examples/configure-index
index 93e96cf16..df6bbb1e3 100644
--- a/doc/examples/configure-index
+++ b/doc/examples/configure-index
@@ -450,7 +450,7 @@ Debug
aptcdrom "false"; // Show found package files
IdentCdrom "false";
acquire::netrc "false"; // netrc parser
-
+ RunScripts "false"; // debug invocation of external scripts
}
pkgCacheGen::Essential "native"; // other modes: all, none, installed