From: Michael Vogt Date: Tue, 1 Apr 2014 10:28:56 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/debian/sid' into feature/apt-manpage X-Git-Tag: 1.0~9^2~1 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/be20eef52da4b7f361333ea70a8d705a98ae779e?hp=-c Merge remote-tracking branch 'upstream/debian/sid' into feature/apt-manpage Conflicts: cmdline/apt.cc --- be20eef52da4b7f361333ea70a8d705a98ae779e diff --combined cmdline/apt.cc index 60a83c7ce,5dbf868d7..b69aeef2d --- a/cmdline/apt.cc +++ b/cmdline/apt.cc @@@ -11,39 -11,12 +11,12 @@@ // Include Files /*{{{*/ #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - - + #include #include - #include - #include #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include #include - #include - #include - #include - - #include + #include + #include #include #include @@@ -55,13 -28,16 +28,16 @@@ #include #include #include - #include #include - /*}}}*/ + #include + #include + #include + #include + /*}}}*/ - 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__); @@@ -71,18 -47,20 +47,20 @@@ _("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; @@@ -90,16 -68,27 +68,27 @@@ 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}, @@@ -119,9 -108,10 +108,10 @@@ 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); @@@ -132,6 -122,17 +122,17 @@@ 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 459b18b6c,1d98362c1..5d0d4c9f0 --- a/doc/apt-verbatim.ent +++ b/doc/apt-verbatim.ent @@@ -219,7 -219,7 +219,7 @@@ "> - + @@@ -247,24 -247,6 +247,24 @@@ &synopsis-filename;"> -v--version -h--help"> + + apt + + &synopsis-arg-option; + &synopsis-arg-config; + &synopsis-arg-target-release; + &synopsis-arg-architecture; + + list + search + show + update + upgrade + install &synopsis-arg-pkgver; + remove &synopsis-arg-pkg; + &synopsis-help; + +"> apt-get