From 0eceebbdfdc2c5e1d677bff95a9ac1ef2f728337 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 27 Jan 2019 08:27:33 +0100 Subject: Add a "reinstall" command as an alias for "install --reinstall". aptitude has a similar "reinstall" command for precedent. --- apt-private/private-cmndline.cc | 6 +++--- apt-private/private-install.cc | 4 +++- cmdline/apt-get.cc | 1 + cmdline/apt.cc | 1 + doc/apt-get.8.xml | 4 ++++ doc/apt.8.xml | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 87deb6bf0..494928332 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -175,7 +175,7 @@ static bool addArgumentsAPTHelper(std::vector &Args, char con /*}}}*/ static bool addArgumentsAPTGet(std::vector &Args, char const * const Cmd)/*{{{*/ { - if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", + if (CmdMatches("install", "reinstall", "remove", "purge", "upgrade", "dist-upgrade", "dselect-upgrade", "autoremove", "autopurge", "full-upgrade")) { addArg(0, "show-progress", "DpkgPM::Progress", 0); @@ -239,7 +239,7 @@ static bool addArgumentsAPTGet(std::vector &Args, char const else if (CmdMatches("moo")) addArg(0, "color", "APT::Moo::Color", 0); - if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", + if (CmdMatches("install", "reinstall", "remove", "purge", "upgrade", "dist-upgrade", "dselect-upgrade", "autoremove", "auto-remove", "autopurge", "clean", "autoclean", "auto-clean", "check", "build-dep", "full-upgrade", "source")) { @@ -291,7 +291,7 @@ static bool addArgumentsAPTMark(std::vector &Args, char const { addArg('f',"file","Dir::State::extended_states",CommandLine::HasArg); } - else if (CmdMatches("install", "remove", "deinstall", "purge", + else if (CmdMatches("install", "reinstall", "remove", "deinstall", "purge", "showinstall", "showinstalls", "showremove", "showremoves", "showdeinstall", "showdeinstalls", "showpurge", "showpurges")) ; diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 1713ff308..243b75b1c 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -586,7 +586,9 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vectorSet("APT::Get::ReInstall", "true"); + else if (strcasecmp(CmdL.FileList[0],"remove") == 0) fallback = MOD_REMOVE; else if (strcasecmp(CmdL.FileList[0], "purge") == 0) { diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6d25ed509..da18d2d19 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -405,6 +405,7 @@ static std::vector GetCommands() /*{{{*/ {"update", &DoUpdate, _("Retrieve new lists of packages")}, {"upgrade", &DoUpgrade, _("Perform an upgrade")}, {"install", &DoInstall, _("Install new packages (pkg is libc6 not libc6.deb)")}, + {"reinstall", &DoInstall, _("Reinstall packages (pkg is libc6 not libc6.deb)")}, {"remove", &DoInstall, _("Remove packages")}, {"purge", &DoInstall, _("Remove packages and config files")}, {"autoremove", &DoInstall, _("Remove automatically all unused packages")}, diff --git a/cmdline/apt.cc b/cmdline/apt.cc index f508406d1..d388e4af4 100644 --- a/cmdline/apt.cc +++ b/cmdline/apt.cc @@ -63,6 +63,7 @@ static std::vector GetCommands() /*{{{*/ // package stuff {"install", &DoInstall, _("install packages")}, + {"reinstall", &DoInstall, _("reinstall packages")}, {"remove", &DoInstall, _("remove packages")}, {"autoremove", &DoInstall, _("Remove automatically all unused packages")}, {"auto-remove", &DoInstall, nullptr}, diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index 184282e69..b83eabd27 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -143,6 +143,10 @@ with a '^' or '$' character, or create a more specific regular expression. + + reinstall is an alias for install --reinstall. + + remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its diff --git a/doc/apt.8.xml b/doc/apt.8.xml index 626419ec3..08492bf54 100644 --- a/doc/apt.8.xml +++ b/doc/apt.8.xml @@ -69,7 +69,7 @@ - , , (&apt-get;) + , , , (&apt-get;) Performs the requested action on one or more packages specified via ®ex;, &glob; or exact match. The requested action can be overridden for specific packages by append a plus (+) to the -- cgit v1.2.3