Pdf-writer doesn't work right on 528 full install

Please post any bugs you have found
Post Reply
Message
Author
User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

Pdf-writer doesn't work right on 528 full install

#1 Post by Moose On The Loose »

file: usr/lib/cups/backend/pdf-writer

at line: 69

Code: Select all

PUPPY_LINUX=`uname -a | grep -ic puppy`
the string returned by uname doesn't have the string "puppy" in it. We need a better test for this being Puppy or to comment out the section that uses this variable or to make uname return puppy.

I have kludged it to work but I think a better fix than the commenting out, needs to be done. This is getting near the limits of my skill level in puppy linux stuff. I don't know the best way to know that we are in any of the many many versions of puppy.
ndujoe1
Posts: 851
Joined: Mon 05 Dec 2005, 01:06

Making PDF's

#2 Post by ndujoe1 »

I take the lazy man's option and create PDF's with Open office.
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

Re: Pdf-writer doesn't work right on 528 full install

#3 Post by rcrsn51 »

Moose On The Loose wrote:We need a better test for this being Puppy or to comment out the section that uses this variable or to make uname return puppy.
This is a long-standing issue. In your case, was it caused by you changing the hostname?

One simple fix is this:

Code: Select all

PUPPY_LINUX=`uname -a | grep -ic $(hostname)`
User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

Re: Pdf-writer doesn't work right on 528 full install

#4 Post by Moose On The Loose »

rcrsn51 wrote:
Moose On The Loose wrote:We need a better test for this being Puppy or to comment out the section that uses this variable or to make uname return puppy.
This is a long-standing issue. In your case, was it caused by you changing the hostname?

One simple fix is this:

Code: Select all

PUPPY_LINUX=`uname -a | grep -ic $(hostname)`
That doesn't seem any better than simply commenting out the place where it is used. I've been thinking of perhaps looking for some file that only is used on puppy. in /tmp, there appears to be several to choose from. This too seems a little too much like a kludge.

For a change that I publish, I want something clean. Just to get stuff going, nearly anything will do.
woodenshoe

Re: Pdf-writer doesn't work right on 528 full install

#5 Post by woodenshoe »

It stopped working in 431 frugal after I changed the hostname to something that didn't include "puppy" in it.

I tracked down the problem in /usr/lib/cups/backend/pdf-writer and fixed it with this:

Code: Select all

--- pdf-writer.original	2007-09-13 22:04:48.000000000 -0500
+++ pdf-writer.new	2012-10-19 11:46:47.000000000 -0500
@@ -66,6 +66,9 @@
 LOCALE="`locale | grep LANG | cut -f 2 -d =`"
 REMOTE_OR_TEST="FALSE"
 PUPPY_LINUX=`uname -a | grep -ic puppy`
+if [ $PUPPY_LINUX -eq 0 ]; then
+	[ -f "/initrd/DISTRO_SPECS" ] && PUPPY_LINUX="1"
+fi
 
 # set path so our script can find all necessary utilites
 export PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R7/bin
I don't know if /initrd/DISTRO_SPECS is in all versions of puppy though. Or for that matter if any other linux distros use it.
User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

Re: Pdf-writer doesn't work right on 528 full install

#6 Post by Moose On The Loose »

woodenshoe wrote:It stopped working in 431 frugal after I changed the hostname to something that didn't include "puppy" in it.

I tracked down the problem in /usr/lib/cups/backend/pdf-writer and fixed it with this:

Code: Select all

--- pdf-writer.original	2007-09-13 22:04:48.000000000 -0500
+++ pdf-writer.new	2012-10-19 11:46:47.000000000 -0500
@@ -66,6 +66,9 @@
 LOCALE="`locale | grep LANG | cut -f 2 -d =`"
 REMOTE_OR_TEST="FALSE"
 PUPPY_LINUX=`uname -a | grep -ic puppy`
+if [ $PUPPY_LINUX -eq 0 ]; then
+	[ -f "/initrd/DISTRO_SPECS" ] && PUPPY_LINUX="1"
+fi
 
 # set path so our script can find all necessary utilites
 export PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R7/bin
I don't know if /initrd/DISTRO_SPECS is in all versions of puppy though. Or for that matter if any other linux distros use it.
Perhaps /tmp/pup_event* would be a better test. Does anyone else use the puppy event system?
User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#7 Post by rerwin »

How about /etc/rc.d/PUPSTATE? I think that has been around forever. /tmp/pup_event* was introduced in the "zzz" package during wary/quirky development, so would not work in 4.3.1, lucid pup or fatdog64 -- anything not woof-based.

I am adding this to my to-do list for a service/upgrade pack for lupu528.

Code: Select all

[ -f /etc/rc.d/PUPSTATE ] && PUPPY_LINUX=1 || PUPPY_LINUX=0
in place of the existing PUPPY_LINUX= line.

rcrsn51, I am not familiar with the issue that spawned this thread, but see in the code a check that includes not-using-puppy, that exits the script. My guess is that the writer does not work. The code that uses PUPPY_LINUX:

Code: Select all

	#if we are are not using puppylinux and ~/.Xauthority does not exists, exit gracefully with warning
	if [ "$REMOTE_OR_TEST" != "TRUE" -a ! -f "$XAUTHORITY" -a $PUPPY_LINUX -eq 0 ]; then
		logger "pdf-writer: WARNING: $XAUTHORITY not found! Switch to console mode!"
		exit 0
	fi
Richard
Last edited by rerwin on Sat 26 Jan 2013, 23:41, edited 1 time in total.
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#8 Post by rcrsn51 »

With all due respect, why is this an issue? Under what circumstances would pdf-writer be run where the host computer was NOT Puppy?
woodenshoe

#9 Post by woodenshoe »

With all due respect, why is this an issue? Under what circumstances would pdf-writer be run where the host computer was NOT Puppy?
I don't know... I just thought that whoever modified the script in the first place to make it work in Puppy had a good reason to keep the test in.

But then again, maybe they just wanted to make sure they didn't break anything. :wink:
Post Reply