]> git.saurik.com Git - apt.git/commitdiff
Merge remote-tracking branch 'upstream/debian/sid' into feature/apt-manpage
authorMichael Vogt <mvo@ubuntu.com>
Tue, 1 Apr 2014 10:28:56 +0000 (12:28 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Tue, 1 Apr 2014 10:28:56 +0000 (12:28 +0200)
Conflicts:
cmdline/apt.cc

1  2 
cmdline/apt.cc
doc/apt-verbatim.ent

diff --combined cmdline/apt.cc
index 60a83c7ceb544929d20964c7d185330b99110c93,5dbf868d79da83af354c9b5ea540c7453027b40d..b69aeef2d0a0b6d26e6b17d13e227a2c0d438861
  // Include Files                                                      /*{{{*/
  #include<config.h>
  
- #include <cassert>
- #include <locale.h>
- #include <iostream>
- #include <unistd.h>
- #include <errno.h>
- #include <regex.h>
- #include <stdio.h>
- #include <iomanip>
- #include <algorithm>
+ #include <apt-pkg/cmndline.h>
  #include <apt-pkg/error.h>
- #include <apt-pkg/cachefile.h>
- #include <apt-pkg/cacheset.h>
  #include <apt-pkg/init.h>
- #include <apt-pkg/progress.h>
- #include <apt-pkg/sourcelist.h>
- #include <apt-pkg/cmndline.h>
- #include <apt-pkg/strutl.h>
- #include <apt-pkg/fileutl.h>
- #include <apt-pkg/pkgrecords.h>
- #include <apt-pkg/srcrecords.h>
- #include <apt-pkg/version.h>
- #include <apt-pkg/policy.h>
- #include <apt-pkg/tagfile.h>
- #include <apt-pkg/algorithms.h>
- #include <apt-pkg/sptr.h>
  #include <apt-pkg/pkgsystem.h>
- #include <apt-pkg/indexfile.h>
- #include <apt-pkg/metaindex.h>
- #include <apt-pkg/hashes.h>
- #include <apti18n.h>
+ #include <apt-pkg/strutl.h>
+ #include <apt-pkg/configuration.h>
  
  #include <apt-private/private-list.h>
  #include <apt-private/private-search.h>
  #include <apt-private/private-upgrade.h>
  #include <apt-private/private-show.h>
  #include <apt-private/private-main.h>
- #include <apt-private/private-utils.h>
  #include <apt-private/private-sources.h>
-                                                                       /*}}}*/
  
+ #include <unistd.h>
+ #include <iostream>
+ #include <vector>
  
+ #include <apti18n.h>
+                                                                       /*}}}*/
  
bool ShowHelp(CommandLine &CmdL)
static bool ShowHelp(CommandLine &)
  {
     ioprintf(c1out,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
            COMMON_ARCH,__DATE__,__TIME__);
      _("Usage: apt [options] command\n"
        "\n"
        "CLI for apt.\n"
-       "Commands: \n"
+       "Basic commands: \n"
        " list - list packages based on package names\n"
        " search - search in package descriptions\n"
        " show - show package details\n"
        "\n"
+       " update - update list of available packages\n"
+       "\n"
        " install - install packages\n"
-       " remove - remove packages\n"
+       " remove  - remove packages\n"
        "\n"
-       " edit-sources - edit the source information file\n"
+       " upgrade - upgrade the system by installing/upgrading packages\n"
+       " full-upgrade - upgrade the system by removing/installing/upgrading packages\n"
        "\n"
-       " update - update list of available packages\n"
-       " upgrade - upgrade the systems packages\n"
+       " edit-sources - edit the source information file\n"
         );
     
     return true;
  
  int main(int argc, const char *argv[])                                        /*{{{*/
  {
-    CommandLine::Dispatch Cmds[] = {{"list",&List},
+    CommandLine::Dispatch Cmds[] = {
+                                    // query
+                                    {"list",&List},
                                     {"search", &FullTextSearch},
                                     {"show", &APT::Cmd::ShowPackage},
-                                    // needs root
+                                    // package stuff
                                     {"install",&DoInstall},
                                     {"remove", &DoInstall},
+                                    {"purge", &DoInstall},
+                                    // system wide stuff
                                     {"update",&DoUpdate},
-                                    {"upgrade",&DoUpgradeWithAllowNewPackages},
+                                    {"upgrade",&DoUpgrade},
+                                    {"full-upgrade",&DoDistUpgrade},
+                                    // for compat with muscle memory
+                                    {"dist-upgrade",&DoDistUpgrade},
                                     // misc
                                     {"edit-sources",&EditSources},
                                     // helper
                                     {"moo",&DoMoo},
                                     {"help",&ShowHelp},
          return 100;
      }
  
-    // FIXME: move into a new libprivate/private-install.cc:Install()
-    _config->Set("DPkgPM::Progress-Fancy", "1");
-    _config->Set("Apt::Color", "1");
+     // some different defaults
 -   _config->CndSet("DPkgPM::Progress", "1");
++   _config->CndSet("DPkgPM::Progress-Fancy", "1");
+    _config->CndSet("Apt::Color", "1");
+    _config->CndSet("APT::Get::Upgrade-Allow-New", true);
  
     // Parse the command line and initialize the package library
     CommandLine CmdL(Args.data(), _config);
        return 100;
     }
  
+    if(!isatty(STDOUT_FILENO) && 
+       _config->FindB("Apt::Cmd::Disable-Script-Warning", false) == false)
+    {
+       std::cerr << std::endl
+                 << "WARNING: " << argv[0] << " "
+                 << "does not have a stable CLI interface yet. "
+                 << "Use with caution in scripts."
+                 << std::endl
+                 << std::endl;
+    }
     // See if the help should be shown
     if (_config->FindB("help") == true ||
         _config->FindB("version") == true ||
diff --combined doc/apt-verbatim.ent
index 459b18b6c0c81151fb1d7b4ceb37c5446eef2e7d,1d98362c17f9a56c82df139ed703970a27db8734..5d0d4c9f0e697c103fa385dc5dfac4c7bb4f73e0
  ">
  
  <!-- this will be updated by 'prepare-release' -->
- <!ENTITY apt-product-version "0.9.14.2">
+ <!ENTITY apt-product-version "0.9.16.1">
  
  <!-- (Code)names for various things used all over the place -->
  <!ENTITY oldstable-codename "squeeze">
  <!ENTITY synopsis-param-filename "<filename><replaceable>&synopsis-filename;</replaceable></filename>">
  <!ENTITY synopsis-help "<arg choice='plain'><group choice='req'><arg choice='plain'>-v</arg><arg choice='plain'>--version</arg></group></arg>
        <arg choice='plain'><group choice='req'><arg choice='plain'>-h</arg><arg choice='plain'>--help</arg></group></arg>">
 +<!ENTITY synopsis-command-apt "<refsynopsisdiv><cmdsynopsis>
 +      <command>apt</command>
 +      <arg><option>-h</option></arg>
 +      &synopsis-arg-option;
 +      &synopsis-arg-config;
 +      &synopsis-arg-target-release;
 +      &synopsis-arg-architecture;
 +      <group choice='req'>
 +              <arg choice='plain'>list</arg>
 +              <arg choice='plain'>search</arg>
 +              <arg choice='plain'>show</arg>
 +              <arg choice='plain'>update</arg>
 +              <arg choice='plain'>upgrade</arg>
 +              <arg choice='plain'>install &synopsis-arg-pkgver;</arg>
 +              <arg choice='plain'>remove &synopsis-arg-pkg;</arg>
 +              &synopsis-help;
 +      </group>
 +</cmdsynopsis></refsynopsisdiv>">
  <!ENTITY synopsis-command-apt-get "<refsynopsisdiv><cmdsynopsis>
        <command>apt-get</command>
        <arg><option>-asqdyfmubV</option></arg>