Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 316777 - net-print/hplip-3.10.2-r4: hp-setup can neither download HPLIP plugin nor install it
Summary: net-print/hplip-3.10.2-r4: hp-setup can neither download HPLIP plugin nor ins...
Status: RESOLVED DUPLICATE of bug 274538
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Denis Dupeyron (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-23 07:46 UTC by Kirikaza
Modified: 2010-05-04 17:54 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
core_install.diff (core_install.diff,427 bytes, patch)
2010-04-26 17:15 UTC, Daniel Pielmeier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kirikaza 2010-04-23 07:46:45 UTC
First of all hp-setup cannot download its plugin via the proxy:

Checking for network connection...
Downloading configuration file from: http://hplip.sf.net/plugin.conf
Downloading configuration: [\                                                                                                          ] 0%
error: I/O Error: invalid proxy for http
Traceback (most recent call last):
  File "/usr/bin/hp-plugin", line 320, in <module>
    plugin_download_callback)
  File "/usr/share/hplip/installer/core_install.py", line 1875, in get_plugin_info
    os.remove(local_conf)
OSError: [Errno 2] No such file or directory: '/tmp/tmpfh3FTb'

And it does not break! It 

If I unset HTTP_PROXY it downloads the plugin and tries to install it. But it fails because of unwanted option -i:

Verifying archive integrity... All good.
Uncompressing HPLIP 3.10.2 Plugin Self Extracting Archive...................................
HP Linux Imaging and Printing System (ver. 3.10.2)
Plugin Installer ver. 3.0
Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.
Self-installs the HPLIP plugin.
Usage: hplip-plugin-install [OPTIONS]
[OPTIONS]
  Set the logging level:                        -l<level> or --logging=<level>                                                                           
                                                <level>: none, info*, error, warn, debug (*default)                                                      
  Run in debug mode:                            -g (same as option: -ldebug)                                                                             
  This help information:                        -h or --help                                                                                             
error: option -i not recognized

I have downloaded the plugin manually (via the proxy) and installed it (w/o -i). It works well.
Comment 1 Daniel Pielmeier gentoo-dev 2010-04-26 17:15:31 UTC
Created attachment 229267 [details, diff]
core_install.diff

I don't know about your HTTP_PROXY problem so I would like to urge you to open an upstream bug about this at https://bugs.launchpad.net/hplip.

Regarding the "error: option -i not recognized" there is already an upstream bug. Can you try if applying the attached patch to /usr/share/hplip/installer/core_install.py fixes this problem.
Comment 2 Daniel Pielmeier gentoo-dev 2010-05-03 17:19:15 UTC
Thanks for filing the upstream bug. Did the patch I have attached work for you regarding the unrecognized option?
Comment 3 Kirikaza 2010-05-03 19:47:10 UTC
FYI: the error "-i: is located in hp-plugin. The latter downloads and installs the plugin. Because the plugin has been installed already hp-setup does not even try to install them again. hp-plugin seems to be the only way to re-install the plugin and to try your patch.

Secondly I cannot apply your patch. I do not know why. It seems to be correct but `patch <your_patch` says "Hunk #1 FAILED at 1990" and goes away. Is there another right method to apply a patch?

If I remove "-- -i" from line 1993 manually it works well! :)
Comment 4 Daniel Pielmeier gentoo-dev 2010-05-03 22:59:24 UTC
(In reply to comment #3)
> FYI: the error "-i: is located in hp-plugin. The latter downloads and installs
> the plugin. Because the plugin has been installed already hp-setup does not
> even try to install them again. hp-plugin seems to be the only way to
> re-install the plugin and to try your patch.

The problem is how hp-plugin calls the installer from the downloaded run file. hp-setup calls hp-plugin which in turn executes run_plugin from core_install.py which is the file I attached the patch for. core_install.py in turn executes the downloaded plugin run file with the -i or -u option like you see in the patch. The problem is if you have built hplip without gui portions (USE="-qt4") neither the "-i" nor the "-u" option is available.

hp-setup is probably checking if the plugin is already installed  but hp-plugin does not. This is why you can not install the plugin by using hp-setup twice.

> Secondly I cannot apply your patch. I do not know why. It seems to be correct
> but `patch <your_patch` says "Hunk #1 FAILED at 1990" and goes away. Is there
> another right method to apply a patch?

It is possible that I did something wrong when creating the patch, I will take a look at this when I apply it from within the ebuild.

> If I remove "-- -i" from line 1993 manually it works well! :)
> 

So if you run hp-plugin with the manually patched file the installation completes without error?
Comment 5 Kirikaza 2010-05-04 04:32:39 UTC
(In reply to comment #4)
> So if you run hp-plugin with the manually patched file the installation
> completes without error?
Yes, without error! (If I do not use my proxy of course.)

> hp-setup is probably checking if the plugin is already installed but hp-plugin does not. 
hp-setup checks and run hp-plugin if plugin not installed:
365:        plugin_installed = utils.to_bool(sys_state.get('plugin', 'installed', '0'))
366:        if plugin > PLUGIN_NONE and not plugin_installed:
...:            ...

And hp-plugin checks too but it asks to re-install the plugin:
275:        if core.check_for_plugin() and plugin_path is None:
276:            log.info("The driver plugin for HPLIP %s appears to already be installed." % version)
277:
278:            cont, ans = tui.enter_yes_no("Do you wish to download and re-install the plug-in?")
Comment 6 Daniel Pielmeier gentoo-dev 2010-05-04 07:21:32 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > So if you run hp-plugin with the manually patched file the installation
> > completes without error?
> Yes, without error! (If I do not use my proxy of course.)

Okay so I will add this fix to the ebuild. There used to be another plugin patch which does not seem to work, so I will replace it with this one.

Your problem with the proxy will be hopefully dealt upstream soon.
Comment 7 Daniel Pielmeier gentoo-dev 2010-05-04 17:54:25 UTC
+  04 May 2010; Daniel Pielmeier <billie@gentoo.org>
+  files/hplip-3.10.2-plugin.patch:
+  Another try to fix plugin installation. This should fix bug #274538 and
+  #316777.

I have committed the patch. Now it applies fine. Thanks you very much for your help. I will resolve this bug as a duplicate of bug #274538 as this one is older and about the same issue.

*** This bug has been marked as a duplicate of bug 274538 ***