Просмотр исходного кода

Make auto-remove and auto-clean aliases for the versions without -

Some people type them instead of autoremove and autoclean, so make
them happy.

Closes: #274159
Makes-Happy: Ansgar
Julian Andres Klode лет назад: 11
Родитель
Сommit
f66738d7fb
4 измененных файлов с 8 добавлено и 5 удалено
  1. 2 2
      apt-private/private-cmndline.cc
  2. 2 1
      apt-private/private-install.cc
  3. 2 0
      cmdline/apt-get.cc
  4. 2 2
      doc/apt-get.8.xml

+ 2 - 2
apt-private/private-cmndline.cc

@@ -169,14 +169,14 @@ static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const
       addArg(0,"format","APT::Get::IndexTargets::Format", CommandLine::HasArg);
       addArg(0,"format","APT::Get::IndexTargets::Format", CommandLine::HasArg);
       addArg(0,"release-info","APT::Get::IndexTargets::ReleaseInfo", 0);
       addArg(0,"release-info","APT::Get::IndexTargets::ReleaseInfo", 0);
    }
    }
-   else if (CmdMatches("clean", "autoclean", "check", "download", "changelog") ||
+   else if (CmdMatches("clean", "autoclean", "auto-clean", "check", "download", "changelog") ||
 	    CmdMatches("markauto", "unmarkauto")) // deprecated commands
 	    CmdMatches("markauto", "unmarkauto")) // deprecated commands
       ;
       ;
    else if (CmdMatches("moo"))
    else if (CmdMatches("moo"))
       addArg(0, "color", "APT::Moo::Color", 0);
       addArg(0, "color", "APT::Moo::Color", 0);
 
 
    if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade",
    if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade",
-	    "dselect-upgrade", "autoremove", "clean", "autoclean", "check",
+	    "dselect-upgrade", "autoremove", "auto-remove", "clean", "autoclean", "auto-clean", "check",
 	    "build-dep", "full-upgrade", "source"))
 	    "build-dep", "full-upgrade", "source"))
    {
    {
       addArg('s', "simulate", "APT::Get::Simulate", 0);
       addArg('s', "simulate", "APT::Get::Simulate", 0);

+ 2 - 1
apt-private/private-install.cc

@@ -519,7 +519,8 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
       _config->Set("APT::Get::Purge", true);
       _config->Set("APT::Get::Purge", true);
       fallback = MOD_REMOVE;
       fallback = MOD_REMOVE;
    }
    }
-   else if (strcasecmp(CmdL.FileList[0], "autoremove") == 0)
+   else if (strcasecmp(CmdL.FileList[0], "autoremove") == 0 ||
+	    strcasecmp(CmdL.FileList[0], "auto-remove") == 0)
    {
    {
       _config->Set("APT::Get::AutomaticRemove", "true");
       _config->Set("APT::Get::AutomaticRemove", "true");
       fallback = MOD_REMOVE;
       fallback = MOD_REMOVE;

+ 2 - 0
cmdline/apt-get.cc

@@ -1643,6 +1643,7 @@ int main(int argc,const char *argv[])					/*{{{*/
                                    {"remove",&DoInstall},
                                    {"remove",&DoInstall},
                                    {"purge",&DoInstall},
                                    {"purge",&DoInstall},
 				   {"autoremove",&DoInstall},
 				   {"autoremove",&DoInstall},
+				   {"auto-remove",&DoInstall},
 				   {"markauto",&DoMarkAuto},
 				   {"markauto",&DoMarkAuto},
 				   {"unmarkauto",&DoMarkAuto},
 				   {"unmarkauto",&DoMarkAuto},
                                    {"dist-upgrade",&DoDistUpgrade},
                                    {"dist-upgrade",&DoDistUpgrade},
@@ -1650,6 +1651,7 @@ int main(int argc,const char *argv[])					/*{{{*/
 				   {"build-dep",&DoBuildDep},
 				   {"build-dep",&DoBuildDep},
                                    {"clean",&DoClean},
                                    {"clean",&DoClean},
                                    {"autoclean",&DoAutoClean},
                                    {"autoclean",&DoAutoClean},
+                                   {"auto-clean",&DoAutoClean},
                                    {"check",&DoCheck},
                                    {"check",&DoCheck},
 				   {"source",&DoSource},
 				   {"source",&DoSource},
                                    {"download",&DoDownload},
                                    {"download",&DoDownload},

+ 2 - 2
doc/apt-get.8.xml

@@ -214,7 +214,7 @@
      <filename>&cachedir;/archives/partial/</filename>.</para></listitem>
      <filename>&cachedir;/archives/partial/</filename>.</para></listitem>
      </varlistentry>
      </varlistentry>
 
 
-     <varlistentry><term><option>autoclean</option></term>
+     <varlistentry><term><option>autoclean</option> (and the <option>auto-clean</option> alias since 1.1)</term>
      <listitem><para>Like <literal>clean</literal>, <literal>autoclean</literal> clears out the local 
      <listitem><para>Like <literal>clean</literal>, <literal>autoclean</literal> clears out the local 
      repository of retrieved package files. The difference is that it only 
      repository of retrieved package files. The difference is that it only 
      removes package files that can no longer be downloaded, and are largely 
      removes package files that can no longer be downloaded, and are largely 
@@ -224,7 +224,7 @@
      erased if it is set to off.</para></listitem>
      erased if it is set to off.</para></listitem>
      </varlistentry>
      </varlistentry>
 
 
-     <varlistentry><term><option>autoremove</option></term>
+     <varlistentry><term><option>autoremove</option> (and the <option>auto-remove</option> alias since 1.1)</term>
      <listitem><para><literal>autoremove</literal> is used to remove packages that were automatically
      <listitem><para><literal>autoremove</literal> is used to remove packages that were automatically
      installed to satisfy dependencies for other packages and are now no longer needed.</para></listitem>
      installed to satisfy dependencies for other packages and are now no longer needed.</para></listitem>
      </varlistentry>
      </varlistentry>