Bug#755088: please show removals *last* in dist-upgrade
[To the actor who has the honor to play me in the theater adoption of my biography reading this to prepare properly for the role of his lifetime: Don't play me cocky or passive aggressive, even if this mail sounds a bit like it; this isn't intended as such. ;) ] On Tue, Jul 29, 2014 at 05:50:29PM +0200, Michael Vogt wrote: On Thu, Jul 17, 2014 at 12:28:09PM -0400, Joey Hess wrote: So, I suggest sorting the output with the most important items last, to go with the UPPERCASE highlighting apt already gives them. This is a excellent idea! You've gotta be kidding me! YOU HAVE GOTTA BE FU**ING KIDDING ME! Attached is a patch that implements it as the new default for apt. It is the beginning of May 2009, a young student and linux greenhorn begins hacking on a tool he is using every day now while using Debian sid [based sidux, now called aptosid] (as nothing else supported his wlan card properly) to fix the most annoying problems in it. The first five issues he tackled were: - allow codenames to specify a release via -t - add possibility to reorder the warning section (Warning-Order) - working simulation for normal users with -s - (configureable) colorization of ShowLists titles - enhance debugging output of depcache A few more things followed, a few days/weeks later he actually published this by sending the easier ones to open bugreports and dropping the entire branch on launchpad. Shortly after that a strange man contacted the student who had noticed his activities … As for apt-get I am a little bit concerned that changing this breaks some peoples workflow. So maybe switching the default for apt-get in 1.2? Or am I too conservative here :) ? … he said he liked most of what he saw. Stuff like the reordering or color would not be possible (beside that he also didn't like it) for backward-compatibility reasons, but the rest would be fine and great and all and we should work together, improve it further and merge it. The young student was happy. He hadn't imagined that the stuff he had hacked together would be deemed good enough for worldwide deployment! Of course, he still liked his reorder and the color, but the man had reasons and the student was not experienced enough to counter this. Five years later, the once die-hard crusader for the church of never change the output became soft and proposes himself to change the output causing his student to stand in disbelieve on the sideline… For general entertainment, I have attached the commit from back then as this bzr branch itself isn't available online anymore. There might be still some ideas hidden in it (read: documentation and maybe error checking?) even if the code is dated by now. Also, if we reorder by default, I think the order should be: Upgraded,New,Hold,Kept,Remove,Downgraded,Essential,Stats New after Upgraded is probably a bit unusual, but from a pure, ordered by interest point of view, new packages are probably more interesting than packages which get just a new version. About Downgrade I am not really sure: It isn't done automatic and the user propably knows what he requested himself, but they are generally dangerous (as they aren't supported), so … I am usually not that well suited as no-change-crusader, but as you force me to it: I would say 'apt' is fair game as it is advertised as such, but we should keep apt-get as-is forever even if I am hopeful that nothing is depending that much on the output order to really care (expect our own testcases maybe). We should also look into having binary-specific configuration trees (something like: If binary is apt-bla, merge Command::apt-bla-tree into root-tree). This branch includes also some other changes which never went into mainline, so expect some commits after I am back from my holiday… You owe me, my friend! Like big time… ;) Best regards David Kalnischkies revno: 1782 committer: David Kalnischkies kalnischk...@gmail.com branch nick: apt timestamp: Thu 2009-05-07 23:50:11 +0200 message: [apt-get] add possibility to reorder the warning section (Warning-Order) * apply on all operations installing (or removing) packages * two translatable strings (malformed errormessages) and a bit of doc * Suggest and Recommend is not included in this reordering (for now) diff: === modified file 'cmdline/apt-get.cc' --- cmdline/apt-get.cc 2009-04-14 12:17:40 + +++ cmdline/apt-get.cc 2009-05-07 21:50:11 + @@ -753,18 +753,51 @@ bool Essential = false; // Show all the various warning indicators - ShowDel(c1out,Cache); - ShowNew(c1out,Cache); - if (ShwKept == true) - ShowKept(c1out,Cache); - Fail |= !ShowHold(c1out,Cache); - if (_config-FindB(APT::Get::Show-Upgraded,true) == true) - ShowUpgraded(c1out,Cache); - Fail |= !ShowDowngraded(c1out,Cache); - if (_config-FindB(APT::Get::Download-Only,false) == false) -Essential = !ShowEssential(c1out,Cache); - Fail |=
Bug#755088: please show removals *last* in dist-upgrade
On Thu, Jul 17, 2014 at 12:28:09PM -0400, Joey Hess wrote: Package: apt Version: 1.0.5 Severity: wishlist Thanks for your bugreport. Many of apt's users are human, and thus prone to making mistakes. A common mistake seems to be running apt-get dist-upgrade and not noticing that it wants to remove your backup system and/or terminal emulator and/or steam. Or not noticing that it wants to install horrible-enormous-thing and/or steam. It doesn't help that the message about this is buried in the middle of masses of other data that are liable to be skimmed at best, and scroll right off the terminal at worst. [..] So, I suggest sorting the output with the most important items last, to go with the UPPERCASE highlighting apt already gives them. This is a excellent idea! Attached is a patch that implements it as the new default for apt. As for apt-get I am a little bit concerned that changing this breaks some peoples workflow. So maybe switching the default for apt-get in 1.2? Or am I too conservative here :) ? Cheers, Michael diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index e08cd80..58639b2 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -61,19 +61,33 @@ bool InstallPackages(CacheFile Cache,bool ShwKept,bool Ask, bool Safety) bool Fail = false; bool Essential = false; - // Show all the various warning indicators - ShowDel(c1out,Cache); - ShowNew(c1out,Cache); - if (ShwKept == true) - ShowKept(c1out,Cache); - Fail |= !ShowHold(c1out,Cache); - if (_config-FindB(APT::Get::Show-Upgraded,true) == true) - ShowUpgraded(c1out,Cache); + // Show all the various warning indicators in the users prefered way + std::vectorstd::string StatsOrder = _config-FindVector( + APT::Cmd::Stats-Order, remove,new,keep,hold,upgrade,stats); + for(std::vectorstd::string::const_iterator I = StatsOrder.begin(); + I != StatsOrder.end(); ++I) + { + if(*I == remove) + ShowDel(c1out,Cache); + else if (*I == new) + ShowNew(c1out,Cache); + else if (*I == keep) + { + if (ShwKept == true) +ShowKept(c1out,Cache); + } else if (*I == hold) + Fail |= !ShowHold(c1out,Cache); + else if (*I == upgrade) + { + if (_config-FindB(APT::Get::Show-Upgraded,true) == true) +ShowUpgraded(c1out,Cache); + } else if (*I == stats) + Stats(c1out,Cache); + } Fail |= !ShowDowngraded(c1out,Cache); if (_config-FindB(APT::Get::Download-Only,false) == false) -Essential = !ShowEssential(c1out,Cache); + Essential = !ShowEssential(c1out,Cache); Fail |= Essential; - Stats(c1out,Cache); // Sanity check if (Cache-BrokenCount() != 0) diff --git a/cmdline/apt.cc b/cmdline/apt.cc index 2cfdf8e..329c33d 100644 --- a/cmdline/apt.cc +++ b/cmdline/apt.cc @@ -117,6 +117,8 @@ int main(int argc, const char *argv[]) /*{{{*/ _config-CndSet(Apt::Color, 1); _config-CndSet(APT::Get::Upgrade-Allow-New, true); _config-CndSet(APT::Cmd::Show-Update-Stats, true); + _config-CndSet(APT::Cmd::Stats-Order, + keep,hold,upgrade,new,remove,stats); // Parse the command line and initialize the package library CommandLine CmdL(Args.data(), _config); diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade index 2344629..44f6a80 100755 --- a/test/integration/test-apt-get-upgrade +++ b/test/integration/test-apt-get-upgrade @@ -76,3 +76,28 @@ Conf new-dep (1.0 stable [all]) Conf upgrade-simple (2.0 unstable [all]) Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade +# see if we can customize the order +testequal 'Reading package lists... +Building dependency tree... +The following packages will be upgraded: + upgrade-simple upgrade-with-conflict upgrade-with-new-dep +The following NEW packages will be installed: + new-dep +The following packages will be REMOVED: + conflicting-dep +3 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +After this operation, 0 B of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only dist-upgrade -o Apt::Cmd::Stats-Order=keep,hold,upgrade,new,remove,stats + +# the cmdline apt has a different default ordering +testequal 'Reading package lists... +Building dependency tree... +The following packages will be upgraded: + upgrade-simple upgrade-with-conflict upgrade-with-new-dep +The following NEW packages will be installed: + new-dep +The following packages will be REMOVED: + conflicting-dep +3 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +After this operation, 0 B of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' apt --trivial-only full-upgrade
Bug#755088: please show removals *last* in dist-upgrade
Package: apt Version: 1.0.5 Severity: wishlist Many of apt's users are human, and thus prone to making mistakes. A common mistake seems to be running apt-get dist-upgrade and not noticing that it wants to remove your backup system and/or terminal emulator and/or steam. Or not noticing that it wants to install horrible-enormous-thing and/or steam. It doesn't help that the message about this is buried in the middle of masses of other data that are liable to be skimmed at best, and scroll right off the terminal at worst. pm-utils procps propellor publicsuffix python python-bzrlib python-debianbts python-libxml2 python-minimal python-oauth python-pkg-resources python-secretstorage python3-pkg-resources qlandkartegt rpcbind rsync strace subversion systemd systemd-sysv udev upower x11-apps x11-utils x11-xserver-utils x11proto-input-dev xarchiver xauth xfce4-power-manager xfce4-power-manager-data xfce4-session xfce4-systemload-plugin xfonts-encodings xfonts-utils xserver-common xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-mouse xserver-xorg-input-synaptics xserver-xorg-input-vmmouse xserver-xorg-input-wacom xserver-xorg-video-ati xserver-xorg-video-cirrus xserver-xorg-video-fbdev xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga xserver-xorg-video-modesetting xserver-xorg-video-neomagic xserver-xorg-video-nouveau xserver-xorg-video-openchrome xserver-xorg-video-qxl xserver-xorg-video-r128 xserver-xorg-video-radeon xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident xserver-xorg-video-vesa xserver-xorg-video-vmware 296 upgraded, 5 newly installed, 7 to remove and 18 not upgraded. Need to get 302 MB/305 MB of archives. After this operation, 7,547 kB disk space will be freed. Do you want to continue? [Y/n] y Hypothesis 1: Many humans see the above 25 lines and hit y. Hypothesis 2: Most humans see the below 25 lines and hit n. x11proto-input-dev xarchiver xauth xfce4-power-manager xfce4-power-manager-data xfce4-session xfce4-systemload-plugin xfonts-encodings xfonts-utils xserver-common xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-mouse xserver-xorg-input-synaptics xserver-xorg-input-vmmouse xserver-xorg-input-wacom xserver-xorg-video-ati xserver-xorg-video-cirrus xserver-xorg-video-fbdev xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga xserver-xorg-video-modesetting xserver-xorg-video-neomagic xserver-xorg-video-nouveau xserver-xorg-video-openchrome xserver-xorg-video-qxl xserver-xorg-video-r128 xserver-xorg-video-radeon xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident xserver-xorg-video-vesa xserver-xorg-video-vmware The following NEW packages will be installed: libepoxy0 libevdev2 libghc-cipher-des-dev libndp0 libupower-glib2 The following packages will be REMOVED: libdb5.1 libgl1-mesa-glx:i386 libudev1:i386 obnam python-paramiko python2.6 steam:i386 296 upgraded, 5 newly installed, 7 to remove and 18 not upgraded. Need to get 302 MB/305 MB of archives. After this operation, 7,547 kB disk space will be freed. Do you want to continue? [Y/n] So, I suggest sorting the output with the most important items last, to go with the UPPERCASE highlighting apt already gives them. -- see shy jo signature.asc Description: Digital signature