Explorar o código

* cmdline/apt-get.cc:
- add an --assume-no option for testing to say 'no' to everything

David Kalnischkies %!s(int64=15) %!d(string=hai) anos
pai
achega
d4cfaed3d8
Modificáronse 3 ficheiros con 15 adicións e 2 borrados
  1. 7 1
      cmdline/apt-get.cc
  2. 3 1
      debian/changelog
  3. 5 0
      doc/apt-get.8.xml

+ 7 - 1
cmdline/apt-get.cc

@@ -135,6 +135,11 @@ bool YnPrompt(bool Default=true)
       c1out << _("Y") << endl;
       c1out << _("Y") << endl;
       return true;
       return true;
    }
    }
+   else if (_config->FindB("APT::Get::Assume-No",false) == true)
+   {
+      c1out << _("N") << endl;
+      return false;
+   }
 
 
    char response[1024] = "";
    char response[1024] = "";
    cin.getline(response, sizeof(response));
    cin.getline(response, sizeof(response));
@@ -3245,7 +3250,8 @@ int main(int argc,const char *argv[])					/*{{{*/
       {'s',"dry-run","APT::Get::Simulate",0},
       {'s',"dry-run","APT::Get::Simulate",0},
       {'s',"no-act","APT::Get::Simulate",0},
       {'s',"no-act","APT::Get::Simulate",0},
       {'y',"yes","APT::Get::Assume-Yes",0},
       {'y',"yes","APT::Get::Assume-Yes",0},
-      {'y',"assume-yes","APT::Get::Assume-Yes",0},      
+      {'y',"assume-yes","APT::Get::Assume-Yes",0},
+      {0,"assume-no","APT::Get::Assume-No",0},
       {'f',"fix-broken","APT::Get::Fix-Broken",0},
       {'f',"fix-broken","APT::Get::Fix-Broken",0},
       {'u',"show-upgraded","APT::Get::Show-Upgraded",0},
       {'u',"show-upgraded","APT::Get::Show-Upgraded",0},
       {'m',"ignore-missing","APT::Get::Fix-Missing",0},
       {'m',"ignore-missing","APT::Get::Fix-Missing",0},

+ 3 - 1
debian/changelog

@@ -9,13 +9,15 @@ apt (0.8.16~exp3) UNRELEASEDexperimental; urgency=low
       converting (hopefully) everything to 'long long' (Closes: #632271)
       converting (hopefully) everything to 'long long' (Closes: #632271)
   * ftparchive/writer.cc:
   * ftparchive/writer.cc:
     - generate all checksums in one run over the file for Release
     - generate all checksums in one run over the file for Release
+  * cmdline/apt-get.cc:
+    - add an --assume-no option for testing to say 'no' to everything
 
 
   [ Michael Vogt ]
   [ Michael Vogt ]
   * merge fixes from the debian/unstable upload
   * merge fixes from the debian/unstable upload
   * merge lp:~mvo/apt/sha512-template to get fixes for the 
   * merge lp:~mvo/apt/sha512-template to get fixes for the 
     sha1/md5 verifiation (closes: #632520)
     sha1/md5 verifiation (closes: #632520)
 
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 13 Jul 2011 23:22:14 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 14 Jul 2011 12:01:53 +0200
 
 
 apt (0.8.16~exp2) experimental; urgency=low
 apt (0.8.16~exp2) experimental; urgency=low
 
 

+ 5 - 0
doc/apt-get.8.xml

@@ -422,6 +422,11 @@
      Configuration Item: <literal>APT::Get::Assume-Yes</literal>.</para></listitem>
      Configuration Item: <literal>APT::Get::Assume-Yes</literal>.</para></listitem>
      </varlistentry>
      </varlistentry>
 
 
+     <varlistentry><term><option>--assume-no</option></term>
+     <listitem><para>Automatic "no" to all prompts.
+     Configuration Item: <literal>APT::Get::Assume-No</literal>.</para></listitem>
+     </varlistentry>
+
      <varlistentry><term><option>-u</option></term><term><option>--show-upgraded</option></term>
      <varlistentry><term><option>-u</option></term><term><option>--show-upgraded</option></term>
      <listitem><para>Show upgraded packages; Print out a list of all packages that are to be
      <listitem><para>Show upgraded packages; Print out a list of all packages that are to be
      upgraded. 
      upgraded.