[libyui-qt-pkg] Fix Pattern Categories Order + Debug Views for Patterns #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bugzilla
https://bugzilla.suse.com/show_bug.cgi?id=1216093
Trello
https://trello.com/c/AKKngvcq
Problem
During development of a pattern selector for Agama / ALP, @lslezak noticed that the pattern categories had a different order than the ones in the YaST Qt pattern selector.
So we added some debug views (see below) for the patterns to the YaST Qt pattern selector to investigate which one was right, and it turned out that the new one for Agama had the correct order.
Notice how pattern category "Graphical Environments" uses order 1802 from the last of its patterns "A very basic desktop", not 1000 from "GNOME Desktop Environment (Basic)" as it should.
Similar for pattern category "Desktop Functions" which uses 2000 from "Technical Writing" instead of 1580 from "Multimedia".
Collapsed pattern categories:
Cause
Our software patterns have a field order (type string) to sort them logically rather than alphabetically by name. Each pattern category should pick the first of its patterns and use the order field from that one. But it turned out that the last one was picked instead which was wrong.
Fix
Now using the correct comparison function to really pick the first pattern and not the last. In addition to that, now handling patterns correctly where that field was omitted in the definition and sorting those patterns last.
Notice how each pattern category now really uses its first pattern for the order, not the last.
Collapsed pattern categories in the order that is correct according to the definition. Compare with the other screenshot above with the collapsed categories.
Better keep it Broken for Consistency with Older Releases?
Should we decide that we don't want the fixed categories order, the new debug views are consistent and self-sufficient commits that can be kept regardless.
Alternatively, the pattern definitions (the .spec files of the pattern packages) could be changed to reflect the desired order.
What About NCurses?
The NCurses package selector has a patterns filter, but it doesn't show pattern categories.
New Debug Views
Available in the Qt UI only!
Showing the Pattern Order in an extra Column in the List
(On request, when the new
Y2_SHOW_PATTERNS_ORDER
environment variable is set)Showing Invisible Patterns
(On request, when the new
Y2_SHOW_INVISIBLE_PATTERNS
environment variable is set)This is useful to figure out how a package gets on the system: The user-visible patterns typically consist of a number of invisible patterns as building blocks that often in turn consist of other invisible patterns.
Patterns are just lightweight RPMs, and they use RPM dependencies like Requires, Recommends and Supplements to get other patterns (or packages) into the pool of packages to install. But without seeing those patterns directly, it's very inconvenient to piece that dependency tree together to get a picture how and why packages get installed.
With this new debug view, it's considerably easier. As shown in the screenshot, once the pattern is selected, click on its patterns-xxx package in the right ("Packages") table and switch to the "Dependencies" tab on the bottom panel.
Using Both at the Same Time