Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to update ppds automatically on cups/hplip updates?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Bircoph
Developer
Developer


Joined: 27 Jun 2008
Posts: 261
Location: Moscow

PostPosted: Thu Dec 10, 2009 1:27 am    Post subject: How to update ppds automatically on cups/hplip updates? Reply with quote

Hello there,

for a quite long while I noticed unpleasant thing: after most hplip or cups updates my printers cease to work with different errors, but usually segfault in /usr/libexec/cups/filter/hpcups.

This can be always fixed by reinstalling the printers via cups http interface. I made a diff between old and new /etc/cups/ and it occurs that vital changes are in /etc/cups/ppd/*.ppd files. So it seems that older ppd files are often not compatible with newer hplip/cups releases.

What annoys me is the need of manual regeneration of ppd file for each printer. It would be great to automate this, but I have no idea how. This should be definitely possible because I use the same printers and the same drivers (I select the same drivers each time from cups menu).
_________________
Per aspera ad astra!
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Fri Oct 05, 2012 7:48 pm    Post subject: Reply with quote

Thread necromancy ftw.

I was having the same annoyance so I wrote a script to do it, although this isn't quite as automagic as I'd like and really only works if you're connected to the printer you want to update. But it's better than nothing

Code:
LPSTAT=/usr/bin/lpstat
LPADMIN=/usr/sbin/lpadmin
AWK=/bin/awk
HP_SETUP=/usr/bin/hp-setup

PRINTER_IP=XXX.XXX.XXX.XXX

$LPSTAT -p | $AWK '{print $2}'

echo "Enter the printer queues you want to remove/update, separated by a space"
read printer

for x in $printer
do
$LPADMIN -x $x
done

$HP_SETUP -i -a -x $PRINTER_IP >/dev/null
if [ $? -eq 0 ]
then
        echo "Success!!"
fi


And of course, you can change this around to not specify the IP (and instead do it by autodetect; I do it this way because hplip gives an error if I try the network autodetect). And of course, you could change the IP to be specified by reading it on user input.
_________________
My political stance/bias
slycordinator != slycoordinator
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum