Bug 126256 - net-print/hplip-0.9.9 does not work with foomatic/hpijs drivers & cups
Bug#: 126256 Product:  Gentoo Linux Version: 2006.0 Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: printing@gentoo.org Reported By: brihall@pcisys.net
Component: Ebuilds
URL: 
Summary: net-print/hplip-0.9.9 does not work with foomatic/hpijs drivers & cups
Keywords:  
Status Whiteboard: 
Opened: 2006-03-14 21:04 0000
Description:   Opened: 2006-03-14 21:04 0000
Upgrading to hplip-0.9.9 broke printing for me. Reverting to hp-0.9.8-r2 fixed
the problem. It appeared that with hplip-0.9.9, cups could not see the
foomatic/hpijs drivers, even after repeatedly re-emerging foomatic*, cups, and
hplip (and restarting daemons, rebooting, etc).


Portage 2.1_pre6-r3 (default-linux/x86/2006.0, gcc-3.4.5, glibc-2.4-r0,
2.6.15-ck4 i686)
=================================================================
System uname: 2.6.15-ck4 i686 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.12.0_pre16
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632)
[disabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -mtune=athlon-xp -pipe -Os -funit-at-a-time
-frename-registers -fomit-frame-pointer -fno-ident -msse2"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env
/usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -mtune=athlon-xp -pipe -Os -funit-at-a-time
-frename-registers -fomit-frame-pointer -fno-ident -msse2
-fvisibility-inlines-hidden -fno-enforce-eh-specs"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner"
FEATURES="autoconfig ccache confcache digest distlocks metadata-transfer nodoc
noinfo sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com
/http://mirror.datapipe.net/gentoo http://gentoo.osuosl.org/
http://gentoo.llarian.net/"
LANG="en_US"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 7zip X a52 aac abook acpi allegro alsa apache2 apm arts artworkextra
avi bash-completion berkdb bitmap-fonts bzip2 cairo ccache cdinstall cdio
cdparanoia chroot cli crypt ctype cups dba dbus dedicated dga dio dnd dri dvd
dvdr dvdread effects emboss encode expat ext-png ext-zlib extensions fame
fastbuild fat firefox flatfile foomaticdb force-cgi-redirect fortran ftp gb gd
gdbm gif gimp gimpprint ginac glut glx gmail gmailtimestamps gnome gnome-print
gpgme gphoto2 gpm gs gstreamer gtk gtk2 gzip hal imlib imlib2 inkjar java
joystick jpeg kde keyscrub lame lcd lesstif libdsk libg++ libwww lm_sensors
lynxkeymap lzo mad maildir matrox mbox mcal md5sum memlimit mikmod mimencode
mixer mmap mmx mod motif moznocompose moznoirc moznomail mozsvg mozxmlterm mp3
mpeg mpeg2 mplayer musepack music ncurses net network nptl nptlonly offensive
ofx ogg oggvorbis on-the-fly-crypt opengl oss pam pam_chroot pam_console
pam_timestamp parse-clocks pcre pdf pdflib perl physfs pic png posix ppds
python qt quicktime rar rdesktop readline real rogue rtc scanner sdl server
session shorten simplexml snmp soap sockets sounds sox spell spl sse sse2 ssl
sysfs szip tcltk tcpd tga theora threads tokenizer transcode truetype
truetype-fonts type1 type1-fonts udev unicode usb uudeview v4l v4l2 vfat videos
vnc vorbis wxwindows x11vnc xatrix xface xml xmms xosd xprint xscreensaver xsl
xv xvmc yv12 zip zlib elibc_glibc kernel_linux linguas_en userland_GNU"
Unset:  ASFLAGS, CTARGET, LC_ALL

------- Comment #1 From Brian Hall 2006-03-14 21:10:47 0000 -------
more info:

http://forums.gentoo.org/viewtopic-p-3181138.html

------- Comment #2 From Marcelo Goes 2006-03-15 07:32:37 0000 -------
It works for me, but I masked =0.9.9 until I can test this more thoroughly.

------- Comment #3 From Xake 2006-03-17 13:12:20 0000 -------
I think it is the same problem I have. No foomatic and no gimp-print installed.
I have the ppds useflag installed, and that was sufficient before. Now I have
just one driver showing up in cups, HP-FAX-something.
I believe this message shows the problem.

[quote]make[1]: Leaving directory
`/var/tmp/portage/hplip-0.9.9/work/hplip-0.9.9/prnt/hpijs'
mv: kan inte skriva 

------- Comment #4 From Xake 2006-03-17 13:12:20 0000 -------
I think it is the same problem I have. No foomatic and no gimp-print installed.
I have the ppds useflag installed, and that was sufficient before. Now I have
just one driver showing up in cups, HP-FAX-something.
I believe this message shows the problem.

[quote]make[1]: Leaving directory
`/var/tmp/portage/hplip-0.9.9/work/hplip-0.9.9/prnt/hpijs'
mv: kan inte skriva över katalog
"/var/tmp/portage/hplip-0.9.9/image//usr/share/ppd"
>>> Completed installing hplip-0.9.9 into /var/tmp/portage/hplip-0.9.9/image/[/quote]

Which translates into english something like "could not overwrite the
directory". It comes from this part of the ebuild:

        if use ppds; then
                dodir /usr/share
                mv "${S}"/prnt/hpijs/ppd "${D}"/usr/share
        fi

Becouse of this the ppds do not get installed, and becouse of that cups can't
use them.

------- Comment #5 From Marcelo Goes 2006-04-01 09:43:02 0000 -------
Hmmm, I have a hunch... Would you mind testing with stable Portage (2.0.54)? I
*think* it may have something to do with the new way it deals with dodir...

By the way, hplip-0.9.10 is now in the tree (package.mask'ed), so you might as
well try this version instead.

Thanks for your time! :-)

------- Comment #6 From Brian Hall 2006-04-01 19:11:54 0000 -------
Reverting to stable portage didn't help my issue. First, I tried hplip-0.9.10
using portage-2.1_pre7-r3, no joy. Then reverted to portage-2.0.54, re-emerged
hplip-0.9.10, still no good. I'm back on the latest portage and hplip-0.9.8.

I did notice one thing that seemed a little odd- updating hplip and restarting
the hplip service doesn't work properly, a reboot is required (for instance,
when I switch from non-working 0.9.10 to working 0.9.8). Probably some of the
things hplip depends on should also restart (snmpd, etc).

Also, when I switch from 0.9.8 to a higher version, the new hplip is never
happy about the configuration, maybe the ebuild should/could migrate the
hplip/printer config so that it is compatible with the newer version? I don't
think that's the problem I'm having, since adding a new printer queue via hplip
setup doesn't help either.

------- Comment #7 From Xake 2006-04-03 18:06:28 0000 -------
The problem got nothing to do with portage and more to do with mv.
hplip makes its own "${D}"/usr/share/ppd for its HP-FAX-something so that
directory does already exist when the ebuild issues the commando 

mv "${S}"/prnt/hpijs/ppd "${D}"/usr/share

and since you can't make mv overwrite a directory it fails to move the files to
the correct place.

I don't know if it is more then a dirty fix, but makeing the following change
in the ebuild WORKSFORME:

        if use ppds; then
                dodir /usr/share
-               mv "${S}"/prnt/hpijs/ppd "${D}"/usr/share
+               mv "${S}"/prnt/hpijs/ppd/* "${D}"/usr/share/ppd
        fi

------- Comment #8 From Marcelo Goes 2006-04-05 08:13:00 0000 -------
Brian: a simple restart works for me. Just tested from 0.9.8->0.9.10, I had no
problems. I don't know why you must restart for it to work - probably something
like snmp, like you said. If you can point it out, make sure to mention it.

I added Peter suggestion to cvs. Mind testing it? Hopefully this time it fixes
this bug.

------- Comment #9 From Brian Hall 2006-04-07 20:40:26 0000 -------
No, patching the ebuild didn't work for me. Had to delete the printer 
queue that hplip creates in order to get 0.9.8 working again this time.

Maybe there's something odd about my printer config. Every time I upgrade  
to a newer hplip, the config is messed up and I have to run ./setup again. 
Why doesn't hplip accept the config without having to change something?

------- Comment #10 From Brian Hall 2006-04-07 20:42:26 0000 -------
Created an attachment (id=84182) [details]
my cups config (have several printer queues for ease of use; only 1 real
printer)

------- Comment #11 From Brian Hall 2006-04-07 20:43:06 0000 -------
Created an attachment (id=84183) [details]
hplip conf; I never edit this

------- Comment #12 From Gustavo Michels 2006-05-29 12:06:42 0000 -------
Just a perhaps useful comment: I just upgraded from 0.9.7-r3 to 0.9.11 (for the
new fax capabilities) without a glitch, on a x86 system. Everything is running
fine.

Here's emerge --info:

# emerge --info
Portage 2.0.54 (default-linux/x86/2006.0, gcc-3.4.5, glibc-2.3.5-r2,
2.6.15-gentoo-r1 i686)
=================================================================
System uname: 2.6.15-gentoo-r1 i686 AMD Athlon(TM) XP 2200+
Gentoo Base System version 1.12.0_pre16
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632)
[enabled]
dev-lang/python:     2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe
-momit-leaf-frame-pointer -fno-ident"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config
/usr/kde/3.5/shutdown /usr/lib/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe
-momit-leaf-frame-pointer -fno-ident -Wl,-O1 -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distcc distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://gustavo http://www.las.ic.unicamp.br/pub/gentoo
http://gentoo.mirrors.pair.com"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="pt_BR"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 #cpu #gnome #graphics #kde #other #print #sound #video 3dnow 3dnowext
X acpi apache2 apm berkdb bzip2 cli crypt cups curl dbus dri eds emboss expat
fam foomaticdb fortran gdbm gif gstreamer hal idn imagemagick imlib isdnlog
java jpeg kde lcms libg++ libwww mad mmx mmx2 mmxext mng motif mp3 mpeg ncurses
nls nptl ogg opengl pam pcre pdflib perl png ppds pppd python qt quicktime
readline reflection rtc samba scanner sdl session specific spell spl sse ssl
tcpd threads tiff truetype truetype-fonts udev unicode usb vorbis xml xml2 xorg
xv zeroconf zlib linguas_pt_BR userland_GNU kernel_linux elibc_glibc"   

------- Comment #13 From Stefan Schweizer 2006-06-22 11:12:11 0000 -------
does this work with hplip-1.6.6?

------- Comment #14 From Brian Hall 2006-06-22 18:50:13 0000 -------
It seems to work, hp-levels and hp-toolbox work. However, upgrading from
0.9.8-r2 to 1.6.6 gives me two print "queues", I only want the one already
defined by cups to be used. How can I fix the hplip config to do that?
Shouldn't the emerge have handled this as part of the upgrade?

When I run hp-levels, I get two choices. Oddly, selecting either works fine and
displays the ink levels:

# hp-levels

HP Linux Imaging and Printing System (ver. 1.6.6)
Supply Levels Utility ver. 1.0

Copyright (c) 2003-6 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.


Choose device from probed devices connected on bus(es): usb:

Num.  Device-URI                                CUPS printer(s)                 
----  ---------------------------------------- 
--------------------------------------------------  
0     hp:/usb/DeskJet_970C?serial=MY99N1117TJT                                  
1     hp:/usb/DESKJET_970C?serial=MY99N1117TJT  DESKJET_970C                    

Enter number 0...1 for device (q=quit) ?1

Black cartridge
Part No.: 45 (51645A)
Health: Good/OK
----------------------------------------------------------------------------------------------------
|/////////                                                                     
                   | (approx. 9%)
----------------------------------------------------------------------------------------------------

Tri-color cartridge
Part No.: 78 (C6578DN/C6578AN)
Health: Good/OK
----------------------------------------------------------------------------------------------------
|///////////////////////////////////////////////////////////////////////       
                   | (approx. 71%)
----------------------------------------------------------------------------------------------------

I want to keep choice #1 and remove choice #0. Running hp-setup doesn't help,
or maybe I'm not using it right.

------- Comment #15 From Stefan Schweizer 2006-08-18 16:14:23 0000 -------
sorry, cannot help much with extended hplip config since I do not own the
hardware. Cool to see this fixed though. THanks all