Prechádzať zdrojové kódy

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

David Kalnischkies 17 rokov pred
rodič
commit
ecf59bfcf3
3 zmenil súbory, kde vykonal 9 pridanie a 6 odobranie
  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
    // simulate user-friendly if apt-get has no root privileges
    if (getuid() != 0 && _config->FindB("APT::Get::Simulate") == true)
    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);
       _config->Set("Debug::NoLocking",true);
    }
    }
 
 

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

@@ -364,7 +364,8 @@
      Configuration Item: <literal>APT::Get::Simulate</literal>.</para>
      Configuration Item: <literal>APT::Get::Simulate</literal>.</para>
 
 
      <para>Simulation run as user will deactivate locking (<literal>Debug::NoLocking</literal>)
      <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
      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>
      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";
      Diff-Only "false";
      Tar-Only "false";
      Tar-Only "false";
      Build-Dep-Automatic "true";
      Build-Dep-Automatic "true";
+     Show-User-Simulation-Note "true";
   };
   };
 
 
   Cache 
   Cache