Bug 837770

Summary: yast2-printer: AddDriverDialog works inconsistently regarding HPLIP RPMs (hplip-hpijs versus hplip)
Product: [openSUSE] openSUSE Tumbleweed Reporter: Freek de Kruijf <freek>
Component: YaST2Assignee: Johannes Meixner <jsmeix>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Minor    
Priority: P4 - Low CC: jsmeix
Version: 13.1 Milestone 4   
Target Milestone: 13.1 Beta 1   
Hardware: All   
OS: SUSE Other   
Whiteboard:
Found By: Community User Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Requested y2log.tgz

Description Freek de Kruijf 2013-08-30 10:39:01 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0

During installation with an active HP printer doing the configuration of Printers I pressed Run hp-setup and got the message that hplib was not installed and should activate printer drivers. I did that and got a list with hplip checked. After all I unchecked all these lines and uninstalled all. After that I got this window back checked all I unchecked, among which was hplip, and finally was able to run hp-setup.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Actual Results:  
Line with hplip should be unchecked.

Expected Results:  
Line with hplip should be unchecked and after checking it hplip should be installed, so hp-setup should run.
Comment 1 Johannes Meixner 2013-08-30 15:05:04 UTC
Please provide YaST logs as described here:
http://en.opensuse.org/openSUSE:Bugreport_YaST

You may also have a look at
http://en.opensuse.org/openSUSE:Submitting_bug_reports
Comment 2 Freek de Kruijf 2013-08-30 21:13:31 UTC
Created attachment 555205 [details]
Requested y2log.tgz
Comment 3 Johannes Meixner 2013-09-03 09:07:19 UTC
Many thanks for your report!

It works as implemented intentionally by me in yast2-printer
but my implementation results confusing behaviour for the user.

Explanation:

I use my YCP source file for the explanation.
In 12.3 the YaST modules were automatically translated into Ruby
so that on your 12.3 system you won't have YCP files but Ruby files
where the Ruby files do exactly the same as the YCP files have done
(provided the automated translation did not introduce bugs).

In the YCP source file driveroptions.ycp it is implemented as follows
(excerpt with long lines wrapped here):
-----------------------------------------------------------------------------
any AddDriverDialog()
...
  boolean hplip_installed =
    Printerlib::TestAndInstallPackage( "hplip-hpijs", "installed" );
...
  y2milestone( "entering AddDriverDialog with ...
                hplip_installed:'%5' ...
                hplip_installed ... );
...
    ( `CheckBox
      ( `id("hplip"),
        ...
        hplip_installed
      )
    ),
-----------------------------------------------------------------------------

The crucial point is that intentionally I test only if hplip-hpijs
is installed because hplip-hpijs provides the actual printer driver.

I do not test if hplip is installed because for the plain printing
functionality hplip is not mandatory.

Therefore from a technical point of view it is correct that
the AddDriverDialog shows that the HPLIP driver is installed
when only hplip-hpijs is installed.

Off the top of my head I don't know which printer driver related
packages get installed by default on openSUSE 12.3.
I assume that by default only hplip-hpijs gets installed.
This would be correct and in compliance with
https://bugzilla.novell.com/show_bug.cgi?id=808315

When only hplip-hpijs is installed you cannot run hp-setup
because /usr/bin/hp-setup is provided by hplip.

But when you remove HPLIP via the AddDriverDialog and
afterwards re-install it via the AddDriverDialog,
then the AddDriverDialog does not only install hplip-hpijs
but it installs hplip (which requires hplip-hpijs).

I.e. when you remove and re-install HPLIP via the AddDriverDialog
you get both hplip and hplip-hpijs installed.

Therefore it then works to run hp-setup (that is provided by hplip).

In the end the actual issue is that the AddDriverDialog
works inconsistently regarding HPLIP RPMs.


As far as I see there is no easy "bugfix" for that issue.

I think I would have to do some re-design of the AddDriverDialog
to make that dialog behave more explicit to the user regarding
what actually happens behind.

I tried to hide the hplip-hpijs versus hplip RPM packages stuff
from the user but now your issue report shows me that this does
not work well in the end.

Again many thanks for your report!
Comment 4 Johannes Meixner 2013-09-03 10:05:52 UTC
Typo correction:

In comment#3
"In 12.3 the YaST modules were automatically translated into Ruby
 so that on your 12.3 system you won't have YCP files but Ruby files"
should read
"In 13.1 (openSUSE Factory) the YaST modules were automatically
 translated into Ruby so that on your 13.1 (openSUSE Factory) system
 you won't have YCP files but Ruby files"
Comment 5 Freek de Kruijf 2013-09-03 11:12:59 UTC
Maybe a separate check on the installation of hplip and hplip-hpijs can solve the problem. So when you get the message that you have to install hplip, you will see an unchecked box in front of hplip. So after checking it, the rpm of hplip will be installed and it will work.
There is also some inconsistency in used terms; the error message uses words that are not consistent with words on buttons or items to be checked. Maybe it is the translation, but looking at the English text may improve the user interface.
Comment 6 Johannes Meixner 2013-09-11 12:43:04 UTC
For openSUSE 13.1 I cannot do the re-design of the AddDriverDialog.

I need more time to implement something according to what I wrote in
https://bugzilla.novell.com/show_bug.cgi?id=808315#c3


For openSUSE 13.1 there is a simple band-aid patch to avoid the issue
and result consistent behaviour and sufficiently consistent texts
in the YaST printer module:
-------------------------------------------------------------------------------
--- /usr/share/YaST2/include/printer/driveradd.rb.orig
+++ /usr/share/YaST2/include/printer/driveradd.rb
@@ -62,7 +62,7 @@ module Yast
         "installed"
       )
       hplip_installed = Printerlib.TestAndInstallPackage(
-        "hplip-hpijs",
+        "hplip",
         "installed"
       )
       manufacturer_PPDs_installed = Printerlib.TestAndInstallPackage(
-------------------------------------------------------------------------------

I.e. now it test if hplip is installed.

This results that when only the actual printer driver hplip-hpijs
is installed, the AddDriverDialog shows:

[ ] hplip + hplip-hpijs : Driver for HP Printers and HP All-in-One Devices

This is not fully correct (because only hplip is not installed)
but from a logical point of view it is even still correct because
"hplip + hplip-hpijs" is not installed (when '+' means logical AND).
Comment 7 Johannes Meixner 2013-09-13 12:56:14 UTC
Fixed yast2-printer in its OBS develpoment project "Printing"
via submitrequest 198944 that is forwared as
submitrequest 198945 to openSUSE:Factory.
Comment 8 Bernhard Wiedemann 2013-09-13 13:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (837770) was mentioned in
https://build.opensuse.org/request/show/198945 Factory / yast2-printer