Explorar o código

[apt-get] add possibility to hide the user simulation note

David Kalnischkies %!s(int64=17) %!d(string=hai) anos
pai
achega
ecf59bfcf3
Modificáronse 3 ficheiros con 9 adicións e 6 borrados
  1. 6 5
      cmdline/apt-get.cc
  2. 2 1
      doc/apt-get.8.xml
  3. 1 0
      doc/examples/configure-index

+ 6 - 5
cmdline/apt-get.cc

@@ -2793,11 +2793,12 @@ int main(int argc,const char *argv[])					/*{{{*/
    // simulate user-friendly if apt-get has no root privileges
    if (getuid() != 0 && _config->FindB("APT::Get::Simulate") == true)
    {
-      cout << _("NOTE: This is only a simulation!\n"
-        "      apt-get needs root privileges for real execution.\n"
-        "      Keep also in mind that locking is deactivated,\n"
-        "      so don't depend on the relevance to the real current situation!"
-        ) << std::endl;
+      if (_config->FindB("APT::Get::Show-User-Simulation-Note",true) == true)
+	 cout << _("NOTE: This is only a simulation!\n"
+	    "      apt-get needs root privileges for real execution.\n"
+	    "      Keep also in mind that locking is deactivated,\n"
+	    "      so don't depend on the relevance to the real current situation!"
+	 ) << std::endl;
       _config->Set("Debug::NoLocking",true);
    }
 

+ 2 - 1
doc/apt-get.8.xml

@@ -364,7 +364,8 @@
      Configuration Item: <literal>APT::Get::Simulate</literal>.</para>
 
      <para>Simulation run as user will deactivate locking (<literal>Debug::NoLocking</literal>)
-     automatical and display a notice indicating that this is only a simulation.
+     automatical. Also a notice will be displayed indicating that this is only a simulation,
+     if the option <literal>APT::Get::Show-User-Simulation-Note</literal> is set (Default: true)
      Neigther NoLocking nor the notice will be triggered if run as root (root should know what
      he is doing without further warnings by <literal>apt-get</literal>).</para>
 

+ 1 - 0
doc/examples/configure-index

@@ -55,6 +55,7 @@ APT
      Diff-Only "false";
      Tar-Only "false";
      Build-Dep-Automatic "true";
+     Show-User-Simulation-Note "true";
   };
 
   Cache