Bug#705510: apt: apt-get [dist-]upgrade takes no args, so enforce that
On Tue, Apr 16, 2013 at 06:57:43AM +0800, Daniel Hartwig wrote: Package: apt Version: 0.9.7.9~exp3 Severity: minor Tags: patch Thanks for your bugreport and your patch. apt-get upgrade and dist-upgrade commands take no (package) arguments, yet do not produce an error like others. The patch looks fine, I merged it into the debian-experimental2 branch now. Cheers, Michael -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#705510: apt: apt-get [dist-]upgrade takes no args, so enforce that
Package: apt Version: 0.9.7.9~exp3 Severity: minor Tags: patch Dear deity apt-get upgrade and dist-upgrade commands take no (package) arguments, yet do not produce an error like others. Regards === modified file 'cmdline/apt-get.cc' --- cmdline/apt-get.cc 2013-04-08 13:38:45 + +++ cmdline/apt-get.cc 2013-04-15 22:52:19 + @@ -1845,6 +1845,9 @@ packages */ bool DoUpgrade(CommandLine CmdL) { + if (CmdL.FileSize() != 1) + return _error-Error(_(The upgrade command takes no arguments)); + CacheFile Cache; if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false) return false; @@ -2178,6 +2181,9 @@ /* Intelligent upgrader that will install and remove packages at will */ bool DoDistUpgrade(CommandLine CmdL) { + if (CmdL.FileSize() != 1) + return _error-Error(_(The dist-upgrade command takes no arguments)); + CacheFile Cache; if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false) return false;