X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/c8d49419be9ce10ade643370bf29891f76b5c339..6763aaec8ddded31057733f53c63f15e6b949bd9:/apt-private/private-cmndline.cc diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index c0b5a875f..a21a9dc8c 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -2,19 +2,17 @@ #include #include -#include -#include +#include +#include #include #include -#include "private-cmndline.h" - #include /*}}}*/ -bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/ +APT_SENTINEL static bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/ { va_list args; bool found = false; @@ -33,7 +31,7 @@ bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/ /*}}}*/ #define addArg(w,x,y,z) Args.push_back(CommandLine::MakeArgs(w,x,y,z)) #define CmdMatches(...) strcmp_match_in_list(Cmd, __VA_ARGS__, NULL) -bool addArgumentsAPTCache(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTCache(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("depends", "rdepends", "xvcg", "dotty")) { @@ -62,8 +60,12 @@ bool addArgumentsAPTCache(std::vector &Args, char const * con { addArg(0, "all-names", "APT::Cache::AllNames", 0); } + else if (CmdMatches("unmet")) + { + addArg('i', "important", "APT::Cache::Important", 0); + } else if (CmdMatches("gencaches", "showsrc", "showpkg", "stats", "dump", - "dumpavail", "unmet", "showauto", "policy", "madison")) + "dumpavail", "showauto", "policy", "madison")) ; else return false; @@ -78,7 +80,7 @@ bool addArgumentsAPTCache(std::vector &Args, char const * con return true; } /*}}}*/ -bool addArgumentsAPTCDROM(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTCDROM(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("add", "ident") == false) return false; @@ -96,7 +98,7 @@ bool addArgumentsAPTCDROM(std::vector &Args, char const * con return true; } /*}}}*/ -bool addArgumentsAPTConfig(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTConfig(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("dump")) { @@ -111,12 +113,12 @@ bool addArgumentsAPTConfig(std::vector &Args, char const * co return true; } /*}}}*/ -bool addArgumentsAPTGet(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTGet(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", - "deselect-upgrade", "autoremove")) + "dselect-upgrade", "autoremove", "full-upgrade")) { - addArg(0, "dpkg-progress", "DpkgPM::Progress", 0); + addArg(0, "show-progress", "DpkgPM::Progress", 0); addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0); addArg(0, "purge", "APT::Get::Purge", 0); addArg('V',"verbose-versions","APT::Get::Show-Versions",0); @@ -125,7 +127,8 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const addArg(0, "solver", "APT::Solver", CommandLine::HasArg); if (CmdMatches("upgrade")) { - addArg(0, "allow-new", "APT::Get::UpgradeAllowNew", 0); + addArg(0, "new-pkgs", "APT::Get::Upgrade-Allow-New", + CommandLine::Boolean); } } else if (CmdMatches("update")) @@ -136,6 +139,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const { addArg('b', "compile", "APT::Get::Compile", 0); addArg('b', "build", "APT::Get::Compile", 0); + addArg('P', "build-profiles", "APT::Build-Profiles", CommandLine::HasArg); addArg(0, "diff-only", "APT::Get::Diff-Only", 0); addArg(0, "debian-only", "APT::Get::Diff-Only", 0); addArg(0, "tar-only", "APT::Get::Tar-Only", 0); @@ -144,7 +148,12 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const else if (CmdMatches("build-dep")) { addArg('a', "host-architecture", "APT::Get::Host-Architecture", CommandLine::HasArg); + addArg('P', "build-profiles", "APT::Build-Profiles", CommandLine::HasArg); + addArg(0, "purge", "APT::Get::Purge", 0); addArg(0, "solver", "APT::Solver", CommandLine::HasArg); + // this has no effect *but* sbuild is using it (see LP: #1255806) + // once sbuild is fixed, this option can be removed + addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0); } else if (CmdMatches("clean", "autoclean", "check", "download", "changelog") || CmdMatches("markauto", "unmarkauto")) // deprecated commands @@ -154,7 +163,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", "deselect-upgrade", "autoremove", "clean", "autoclean", "check", - "build-dep")) + "build-dep", "full-upgrade")) { addArg('s', "simulate", "APT::Get::Simulate", 0); addArg('s', "just-print", "APT::Get::Simulate", 0); @@ -163,9 +172,6 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const addArg('s', "no-act", "APT::Get::Simulate", 0); } - if (CmdMatches("upgrade")) - addArg(0, "allow-new", "APT::Get::UpgradeAllowNew", CommandLine::Boolean); - // FIXME: move to the correct command(s) addArg('d',"download-only","APT::Get::Download-Only",0); addArg('y',"yes","APT::Get::Assume-Yes",0); @@ -194,7 +200,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const return true; } /*}}}*/ -bool addArgumentsAPTMark(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTMark(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("auto", "manual", "hold", "unhold", "showauto", "showmanual", "showhold", "showholds", "install", @@ -214,13 +220,19 @@ bool addArgumentsAPTMark(std::vector &Args, char const * cons return true; } /*}}}*/ -bool addArgumentsAPT(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPT(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("list")) { addArg(0,"installed","APT::Cmd::Installed",0); addArg(0,"upgradable","APT::Cmd::Upgradable",0); - addArg('a', "all-versions", "APT::Cmd::AllVersions", 0); + addArg(0,"manual-installed","APT::Cmd::Manual-Installed",0); + addArg('v', "verbose", "APT::Cmd::List-Include-Summary", 0); + addArg('a', "all-versions", "APT::Cmd::All-Versions", 0); + } + else if (CmdMatches("show")) + { + addArg('a', "all-versions", "APT::Cache::AllVersions", 0); } else if (addArgumentsAPTGet(Args, Cmd) || addArgumentsAPTCache(Args, Cmd)) {