Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libyui-qt-pkg] Fix Pattern Categories Order + Debug Views for Patterns #107

Merged
merged 4 commits into from
Oct 10, 2023

Conversation

shundhammer
Copy link
Contributor

@shundhammer shundhammer commented Oct 10, 2023

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.

patterns-wrong-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:

patterns-wrong-order-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.

patterns-fixed-order

Notice how each pattern category now really uses its first pattern for the order, not the last.

patterns-fixed-order-categories

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.

ncurses-patterns

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)

fixed-pattern-category-order

sudo Y2_SHOW_PATTERNS_ORDER=1 yast2 sw_single

Showing Invisible Patterns

(On request, when the new Y2_SHOW_INVISIBLE_PATTERNS environment variable is set)

invisible-patterns

sudo Y2_SHOW_INVISIBLE_PATTERNS=1 yast2 sw_single

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

sudo Y2_SHOW_PATTERNS_ORDER=1 Y2_SHOW_INVISIBLE_PATTERNS=1 yast2 sw_single

Copy link
Member

@lslezak lslezak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks for debugging and fixing! 👍

@shundhammer shundhammer merged commit ff114b7 into master Oct 10, 2023
4 checks passed
@shundhammer shundhammer deleted the huha-pattern-order branch October 10, 2023 14:42
@shundhammer
Copy link
Contributor Author

Submitted manually to Factory: https://build.opensuse.org/request/show/1116919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants