[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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 <kalnischkies@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 +0000
+++ cmdline/apt-get.cc	2009-05-07 21:50:11 +0000
@@ -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 |= Essential;
-   Stats(c1out,Cache);
+   string WarningOrder = _config->Find("APT::Get::Warning-Order",
+      "Remove,New,Kept,Hold,Upgraded,Downgraded,Essential,Stats")+",";
+   short printedSection = 0;
+   size_t NextComma = string::npos;
+   while((NextComma = WarningOrder.find(','))!=string::npos)
+   {
+      string DisplaySection = WarningOrder.substr(0,NextComma);
+      WarningOrder = WarningOrder.substr(NextComma+1);
+      if (DisplaySection == "Remove")
+         ShowDel(c1out,Cache);
+      else if (DisplaySection == "New")
+         ShowNew(c1out,Cache);
+      else if (DisplaySection == "Kept")
+      {
+         if (ShwKept == true)
+            ShowKept(c1out,Cache);
+      }
+      else if (DisplaySection == "Hold")
+         Fail |= !ShowHold(c1out,Cache);
+      else if (DisplaySection == "Upgraded")
+      {
+         if (_config->FindB("APT::Get::Show-Upgraded",true) == true)
+            ShowUpgraded(c1out,Cache);
+      }
+      else if (DisplaySection == "Downgraded")
+         Fail |= !ShowDowngraded(c1out,Cache);
+      else if (DisplaySection == "Essential")
+      {
+         if (_config->FindB("APT::Get::Download-Only",false) == false)
+            Essential = !ShowEssential(c1out,Cache);
+         Fail |= Essential;
+      }
+      else if (DisplaySection == "Stats")
+         Stats(c1out,Cache);
+      else
+         return _error->Error(_("Unknown section \"%s\" specified in APT::Get::Warning-Order!"),
+            DisplaySection.c_str());
+
+      printedSection++;
+   }
+
+   if (printedSection < 8)
+      return _error->Error(
+         _("APT::Get::Warning-Order is malformed! Only %d sections specified; required: %d sections!"),
+         printedSection,8);
 
    // Sanity check
    if (Cache->BrokenCount() != 0)

=== modified file 'doc/apt-get.8.xml'
--- doc/apt-get.8.xml	2009-05-07 10:04:21 +0000
+++ doc/apt-get.8.xml	2009-05-07 21:50:11 +0000
@@ -515,10 +515,18 @@
      This is useful for tools like pbuilder.
      Configuration Item: <literal>APT::Get::AllowUnauthenticated</literal>.</para></listitem>
      </varlistentry>
-     
 
      &apt-commonoptions;
-     
+
+     <varlistentry><term><literal>APT::Get::Warning-Order</literal></term>
+     <listitem><para>Used to specify the order of the sections warning a user
+     about (possible) new, kept, removed and such packages. Default setting is
+     "<literal>Remove,New,Kept,Hold,Upgraded,Downgraded,Essential,Stats</literal>".
+     Note that this option should be used to change the order, it is not suitable to
+     hide sections! &apt-get; will refuse to work if this setting is malformed.
+     </para></listitem>
+     </varlistentry>
+
    </variablelist>
  </refsect1>

Attachment: signature.asc
Description: Digital signature


Reply to: