Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 331163 - net-print/hplip: hp-setup fails to install plugin without dbus-python
Summary: net-print/hplip: hp-setup fails to install plugin without dbus-python
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-04 06:09 UTC by maurerpe
Modified: 2012-11-14 07:19 UTC (History)
2 users (show)

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


Attachments
Transcript for hp-setup with no dbus installed and the new patch applied (hplip_nodbus_newpatch.txt,3.54 KB, text/plain)
2010-08-05 02:25 UTC, maurerpe
Details
Transcript for hp-setup with dbus installed and the new patch applied (hplip_dbus_newpatch.txt,3.43 KB, text/plain)
2010-08-05 02:26 UTC, maurerpe
Details
Transcript for hp-setup with dbus installed and the old patch applied (hplip_dbus_oldpatch.txt,7.73 KB, text/plain)
2010-08-05 02:26 UTC, maurerpe
Details
Transcript for hp-setup with no dbus installed and the old patch applied (hplip_nodbus_oldpatch.txt,3.24 KB, text/plain)
2010-08-05 02:27 UTC, maurerpe
Details
Always allow -i when interactive mode is supported (hplip-3.10.9-interactive.patch,1.50 KB, patch)
2010-11-21 20:33 UTC, maurerpe
Details | Diff
Ebuild that uses hplip-3.10.9-interactive.patch (hplip-3.10.9-r1.ebuild,7.69 KB, text/plain)
2010-11-21 20:34 UTC, maurerpe
Details
Ebuild for 3.11.1 that uses the interactive patch (hplip-3.11.1-r3.ebuild,8.07 KB, text/plain)
2011-02-09 05:44 UTC, maurerpe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maurerpe 2010-08-04 06:09:58 UTC
net-print/hplip-3.10.6 has an RDEPEND on dbus-python, but it is gated by fax.  It also rdepends on dbus-python when the qt4 use flag is present, since PyQt[dbus] depends on dbus-python.  However, if hplip is build -fax and -qt4 it does not depend on dbus-python and dbus-python may not be installed on the users system.  In this case, hplip seems to install, but hp-setup is not able to install the plugin and printing does not work.  dbus-python should be an ungated RDEPEND for hplip.

Reproducible: Didn't try

Steps to Reproduce:
1. emerge --unmerge dbus-python
2. <Somehow delete installed plugin, so hp-setup will try to download again>
3. USE="-fax -qt4" emerge hplip
4. hp-setup

(If you need me to reproduce it, I can try, but it is already 2 am and I have to go to work in the morning).
Actual Results:  
Installing the plugin generates an error

Expected Results:  
Nasty error message, that at the ends asks: is python-dbus installed?

Then hp-setup pretends the error did not occur and attempts to continue with the setup.  Don't see how this could possibly work, so I hit cntl-c to abort.

Note that on a working system, unmerging dbus-python does not stop printing from working.

$ emerge --info
Portage 2.2_rc67 (default/linux/amd64/10.0/desktop, gcc-4.4.3, glibc-2.11.2-r0, 2.6.34-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-r1-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_3800+-with-gentoo-2.0.1
Timestamp of tree: Sun, 01 Aug 2010 03:45:02 +0000
app-shells/bash:     4.0_p37
dev-lang/python:     2.6.5-r2, 3.1.2-r3
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-10.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -mtune=native -msse3 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=athlon64 -mtune=native -msse3 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
FFLAGS="-march=athlon64 -mtune=native -msse3 -O2 -pipe"
GENTOO_MIRRORS="http://mirrors.sohu.com/gentoo/ ftp://gentoo.in.th/ ftp://gentoo.mirrors.tds.net/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlay/maurerpe /usr/local/overlay/awn"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X Xaw3d a52 aac acpi alsa amd64 apm bash-completion berkdb bidi branding bzip2 cairo cdda cddb cdparanoia cdr chroot cleartype cli colordiff consolekit cpudetection cracklib crypt cups cxx dbus dts dv dvd dvdr dvi emacs emboss emerald encode exif fam ffmpeg fftw firefox flac foomaticdb fortran gd gdbm gif gimp glitz gmp gnome gnuplot gphoto2 gpm gs gstreamer gtk gtkhtml gtkspell guile gzip hal http iconv icu id3tag imagemagick ipv6 jpeg jpeg2k lame lapack lcms libnotify lm_sensors lucene mad maildir mbox mdb mikmod mime mmx mmxext mng modules mp3 mp4 mpeg mplayer mudflap multilib musicbrainz nautilus ncurses networking nls nodrm nptl nptlonly nsplugin nvidia ogg openexr opengl openssl pam pango pcre pdf plotutils png posix ppds pppd pulseaudio python qt3support quicktime raw readline reflection regex rtc sbcl scanner sdl secure-delete session sftp sharedmem smp sockets sox spell spl sqlite sqlite3 sse sse2 ssl startup-notification svg sysfs syslog system-sqlite t1lib threads threadsafe tiff timidity toolkit-scroll-bars truetype udev unicode usb vorbis wav wma wmf wxwidgets wxwindows x264 xcb xcomposite xine xml xorg xpm xulrunner xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US en" RUBY_TARGETS="ruby18" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="nv vesa vga fbdev apm nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Daniel Pielmeier gentoo-dev 2010-08-04 08:05:47 UTC
Please also attach or add the actual error message!
Comment 2 maurerpe 2010-08-05 02:24:17 UTC
I had time to look at this again.  Between this bug and Bug 274538, there appear to be two variables: whether or not dbus-python is installed and whether a new patch [1] or an old patch [2] is applied to core_install.py
  [1] http://launchpadlibrarian.net/49192341/core_install.patch
  [2] http://launchpadlibrarian.net/47809379/hplip-3.10.2-plugin.patch

I ran four tests, the full transcripts are included as attachments.
+---------------------------------------------------------+
|             | with dbus-python    | without dbus-python |
+-------------+---------------------+---------------------+
| New patch   |       FAIL          |        FAIL         |
| Old patch   |       PASS          |        FAIL         |
+-------------+---------------------+---------------------+

Commands were:
emerge --unmerge dbus-python
emerge -1 =hplip-3.10.6
hp-setup   <<output attached as nodbus_newpatch>>
emerge dbus-python
hp-setup   <<output attached as dbus_newpatch>>
(cd /usr/share/hplip/; patch -R -p0 < /usr/portage/net-print/hplip/files/hplip-3.10.2-plugin.patch; patch -p0 < ~/Download/hplip-3.10.2-plugin.patch)
hp-setup  <<output attached as dbus_oldpatch>>
emerge --unmerge dbus-python
hp-setup  <<opps, didn't try to install plugin: last run was successful>>
emerge =net-print/hplip-3.10.6  <<remove the downloaded plugin>>
(cd /usr/share/hplip/; patch -R -p0 < /usr/portage/net-print/hplip/files/hplip-3.10.2-plugin.patch; patch -p0 < ~/Download/hplip-3.10.2-plugin.patch)
hp-setup <<output attached as nodbus_oldpatch>>
Comment 3 maurerpe 2010-08-05 02:25:31 UTC
Created attachment 241451 [details]
Transcript for hp-setup with no dbus installed and the new patch applied
Comment 4 maurerpe 2010-08-05 02:26:05 UTC
Created attachment 241453 [details]
Transcript for hp-setup with dbus installed and the new patch applied
Comment 5 maurerpe 2010-08-05 02:26:35 UTC
Created attachment 241455 [details]
Transcript for hp-setup with dbus installed and the old patch applied
Comment 6 maurerpe 2010-08-05 02:27:24 UTC
Created attachment 241457 [details]
Transcript for hp-setup with no dbus installed and the old patch applied
Comment 7 Daniel Pielmeier gentoo-dev 2010-08-05 06:49:28 UTC
Please also add "emerge -pv =net-print/hplip-3.10.6". Next time you can use "emerge --info =net-print/hplip-3.10.6" to append the package configuration to emerge --info.
Comment 8 maurerpe 2010-08-05 13:21:42 UTC
qwerty ~ $ emerge -pv =net-print/hplip-3.10.6

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     UD] net-print/hplip-3.10.6 [3.10.6-r1] USE="X hpcups libnotify scanner -doc -fax -hpijs -minimal -parport -policykit -qt4 -snmp -static-ppds -udev-acl" 0 kB [1=>0]

Total: 1 package (1 downgrade), Size of downloads: 0 kB
Portage tree and overlays:
 [0] /usr/portage
 [1] /usr/local/overlay/

Note that I currently have a version my a local overlay installed that requires dbus-python and applies the "old" patch (I want printing to work while this bug is being processed).  I had the portage version installed when I ran the tests above.

I am happy to provide more information as needed.
Comment 9 Daniel Pielmeier gentoo-dev 2010-11-21 12:47:26 UTC
Added the relevant upstream bug in the URL field. This is the bug which should have fixed the problem. I already commented there.
Comment 10 maurerpe 2010-11-21 20:33:23 UTC
Created attachment 255065 [details, diff]
Always allow -i when interactive mode is supported

Thank you Daniel for identifying the upstream bug.

I recently upgraded to 3.10.9 and noticed the issue still exists.  I had some time to spend on it today and came up with the attached patch.  I think this addresses the root problem, which is that the -i option should always be accepted.

The fix works on my machine.

I also posted the patch to the upstream bug that you identified.
Comment 11 maurerpe 2010-11-21 20:34:19 UTC
Created attachment 255067 [details]
Ebuild that uses hplip-3.10.9-interactive.patch
Comment 12 Daniel Pielmeier gentoo-dev 2010-11-21 20:43:31 UTC
Thank you very much. I hope hplip upstream accepts your patch.
Comment 13 Simon Matthews 2011-02-09 03:25:13 UTC
Can we please get this fixed? 3.11.1-r2 appears to still have the problem:

Downloading plug-in: [************************************************] 100%  8.0 KB     

----------------------
| INSTALLING PLUG-IN |
----------------------

Verifying archive integrity... All good.
Uncompressing HPLIP 3.11.1 Plugin Self Extracting Archive.........................................

HP Linux Imaging and Printing System (ver. 3.11.1)
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
error: Python gobject/dbus may be not installed
Comment 14 maurerpe 2011-02-09 05:44:18 UTC
Created attachment 261895 [details]
Ebuild for 3.11.1 that uses the interactive patch

I can confirm that 3.11.1 still has this issue.  The attached ebuild applies the same patch that I used in 3.10.9.

I second Simon's request to get this fixed in the tree.
Comment 15 maurerpe 2011-02-09 05:49:36 UTC
(In reply to comment #14)
> Created an attachment (id=261895) [details]
> Ebuild for 3.11.1 that uses the interactive patch
> 
> I can confirm that 3.11.1 still has this issue.  The attached ebuild applies
> the same patch that I used in 3.10.9.
> 
> I second Simon's request to get this fixed in the tree.
> 

The other difference between my 3.11.1-r3 and the 3.11.1-r2 in the tree is that I added dbus-python to the depend list.  See bug description and comment #2.
Comment 16 Daniel Pielmeier gentoo-dev 2011-02-09 07:37:01 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > Created an attachment (id=261895) [details] [details]
> > Ebuild for 3.11.1 that uses the interactive patch
> > 
> > I can confirm that 3.11.1 still has this issue.  The attached ebuild applies
> > the same patch that I used in 3.10.9.
> > 
> > I second Simon's request to get this fixed in the tree.
> > 
> The other difference between my 3.11.1-r3 and the 3.11.1-r2 in the tree is that
> I added dbus-python to the depend list.  See bug description and comment #2.

Please do not attach the complete ebuild but a unified diff instead. This makes tracking changes easier and you don't have to explain every minor change.

As you already experienced, upstream hplip is really slow with integrating patches in official releases, thus I refrain from adding every minor patch to the ebuild because I have to maintain this patches for many releases for above reasons. I recommend you to bug upstream more about this issue so it gets integrated somehow.
Comment 17 T6n9naYMKJ 2012-10-26 14:51:36 UTC
I recently wanted to perform a world-update and came across a lot of dbus dependencies caused by hplip (3.12.4 -> 3.12.9-r1). As I discern from this bug, this is needed for hp-setup. Hp-setup itself configures cups/fax support. Long story short: do I really need dbus and hp-setup if I only use the scanner use-flag (everything else disabled)?
Comment 18 Daniel Pielmeier gentoo-dev 2012-11-13 19:18:36 UTC
(In reply to comment #17)
> I recently wanted to perform a world-update and came across a lot of dbus
> dependencies caused by hplip (3.12.4 -> 3.12.9-r1). As I discern from this
> bug, this is needed for hp-setup. Hp-setup itself configures cups/fax
> support. Long story short: do I really need dbus and hp-setup if I only use
> the scanner use-flag (everything else disabled)?

dbus python is needed for other things as well mostly for the update/autoconfigure/plugin-check scripts

@all does installing the plugin succeed with newer versions?
Comment 19 maurerpe 2012-11-14 03:50:35 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > I recently wanted to perform a world-update and came across a lot of dbus
> > dependencies caused by hplip (3.12.4 -> 3.12.9-r1). As I discern from this
> > bug, this is needed for hp-setup. Hp-setup itself configures cups/fax
> > support. Long story short: do I really need dbus and hp-setup if I only use
> > the scanner use-flag (everything else disabled)?
> 
> dbus python is needed for other things as well mostly for the
> update/autoconfigure/plugin-check scripts
> 
> @all does installing the plugin succeed with newer versions?

I upgraded to the latest (net-print/hplip-3.12.10a) and tried it.  hp-setup did not try to install a plugin at all.  I called hp-plugin and hp-plugin -i manually and they both ran successfully.

I also looked at the code in /usr/share/hplip/base/module.py around line 263 and found that a change had been made that would fix this issue.  It is different than the patch attached to this bug, but should work just fine.

The code in question was:
        if self.num_valid_modes > 0:
            if GUI_MODE in self.avail_modes and prop.gui_build:
                params = ''.join([params, 'u'])
                long_params.extend(['gui', 'ui'])

            if INTERACTIVE_MODE in self.avail_modes:
                params = ''.join([params, 'i'])
                long_params.extend(['interactive', 'text'])

            if NON_INTERACTIVE_MODE in self.avail_modes:
                params = ''.join([params, 'n'])
                long_params.extend(['noninteractive', 'non-interactive', 'batch'])

The first line used to read
   if self.num_valid_modes > 1:
which would prevent -i from being recognized when only interactive mode was supported.  Changing to > 0 means that -i is always recognized.

I am not sure why hp-setup did not install the plugin like it did in the past, but that issue is not related to this bug.  At this point, dbus-python is always required as a dependency on the ebuild and the "error: option -i not recognized" is fixed.  The fix is confirmed both by testing hp-plugin -i and by code inspection.

I have marked the bug as resolved fixed.
Comment 20 Daniel Pielmeier gentoo-dev 2012-11-14 07:19:55 UTC
> I upgraded to the latest (net-print/hplip-3.12.10a) and tried it.  hp-setup
> did not try to install a plugin at all.  I called hp-plugin and hp-plugin -i
> manually and they both ran successfully.

Thank you for the feedback.