|
Bugzilla – Full Text Bug Listing |
| Summary: | yast2-packager needs to require yast2-*-pkg and handling of missing pkg widget | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 11.0 | Reporter: | Michal Svec <msvec> |
| Component: | YaST2 | Assignee: | Stefan Hundhammer <shundhammer> |
| Status: | RESOLVED FIXED | QA Contact: | Jiri Srain <jsrain> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | casualprogrammer, mmeeks |
| Version: | Alpha 2 | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | maint:released:11.2:28219 | ||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: | Not so silent ;-) failure to load pkg plugin | ||
1) is a good point, I'm going to add it to ncurses-pkg right away.
2) is already done in nc-pkg (Requires: yast2-ncurses >= 2.16.15), but can't see it in qt-pkg
3) is not that trivial:
I've fixed yast2-ncurses to throw UI Exception (and display evil red error box) if the below ReplaceWidget in inst_packages.ycp client fails:
UI::ReplaceWidget(`rep,
mode == nil ?
`PackageSelector(`id(`packages ), "") ...
It should fail, as `PackageSelector widget is not created if we don't have the appropriate plugin (YUI::widgetFactory()->createPackageSelector() returns NULL)
Now it is up to ycp client to handle the failure and do not call UI::RunPkgSelection, if we don't have PackageSelector widget, possibly offer user to install suitable *-pkg package.
.. and for the latter, we could possibly extend each UI's GetDisplayInfo function to return a string (either of yast2-ncurses-pkg|yast2-qt-pkg|yast2-gtk-pkg) to inform YCP client which package with pkg-selector plugin it needs. To comment #1 3): The package selector is a special widget and there already is UI::HasSpecialWidget() function, it should be also used for checking whether the package selector is available. What do you think? UI::HasSpecialWidget() is query-only function, it does not really create the widgets, it only questions particular UI whether it has capability to create certain widget. So you would not really find out whether `PackageSelector can be created or not. Moreover, `PackageSelector is not an optional (special) widget ;-) and imho it should not become one, because every UI should support it and implement it. The package selector is a mandatory widget. The pattern selector and the simple patch selector, however, are optional widgets.
Anyway, we will probably need a meta-provides like
yast2_ui_pkg
(similar to yast2_ui which yast2-qt, yast2-ncurses, and yast2-gtk provide)
and make yast2-qt-pkg, yast2-ncurses-pkg, and yast2-gtk (and if/when the package part is split off from yast2-gtk yast2-gtk-pkg instead) provide that symbol and yast2-packager require it.
yast2-qt-pkg now provides yast2_ui_pkg yast2-ncurses-pkg now provides yast2_ui_pkg yast2-packager now requires yast2_ui_pkg yast2-qt-pkg now requires yast2-qt yast2-ncurses-pkg already required yast2-ncurses submitted packages - yast2-qt-pkg - yast2-ncurses-pkg - yast2-packager TO DO (-> mmeeks): yast2-gtk should provide yast2_ui_pkg (until we'll get yast2-gtk-pkg, at which point yast2-gtk-pkg should provide yast2_ui_pkg) Please don't feel that gtk+ is somehow different from qt/ncurses :-) do feel free to commit the (I assume fairly trivial) .spec file fix to yast2-gtk at the same time. OK. Done and submitted (yast2-gtk-2.16.5). The fix just ensures there is at least one working package manager widget. But YaST will still fail silently if user is not running the particular working UI. Or am I missing something? (In reply to comment #9 from Stanislav Visnovsky) > The fix just ensures there is at least one working package manager widget. Right. But that's more than we had before. > But YaST will still fail silently if user is not running the particular > working UI. It fails, but it shouldn't fail silently. You should get a YUIException that will result in an error dialog (http://svn.opensuse.org/svn/yast/trunk/ycp-ui-bindings/src/YCPErrorDialog.cc). If that doesn't work, this is another bug that needs to be fixed. Created attachment 196958 [details]
Not so silent ;-) failure to load pkg plugin
Does this look any better?
Duh. It did exit(1) if there was no plug-in. Now throwing a proper exception that displays an error pop-up. *** Bug 364849 has been marked as a duplicate of this bug. *** Update released for: yast2-gtk Products: openSUSE 11.2 (debug, i586, x86_64) |
To prevent broken yast2-packager experience it seems we need several things: - yast2-packager needs to require yast2_pkg (virtual capability) to ensure it could run at least some way, it would be provided by all yast2-*-pkg - yast2-qt-pkg needs to require yast2-qt and ncurses the same way, to ensure at least some level of consistency - yast2-packager needs to check for the widget of the same UI it's running in and warn the user if it's not available (*), to prevent situation with running yast2-qt and having only yast2-ncurses-pkg installed (*) Ideally, it should be able to install the widget at runtime and possibly continue to run.