Add new Debug::RunScripts option
authorMichael Vogt <mvo@ubuntu.com>
Tue, 1 Apr 2014 09:30:00 +0000 (11:30 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Tue, 1 Apr 2014 10:16:03 +0000 (12:16 +0200)
This debug option will display all scripts that are run
by apts RunScripts and RunScriptsWithPkgs helpers.

apt-pkg/contrib/fileutl.cc
apt-pkg/deb/dpkgpm.cc
doc/apt.conf.5.xml
doc/examples/configure-index

index 69406a9..188bb87 100644 (file)
@@ -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);
       }
index 5a5fff1..e68c2ca 100644 (file)
@@ -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;
index 78f6a27..fcbf20d 100644 (file)
@@ -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>
index 93e96cf..df6bbb1 100644 (file)
@@ -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