Page 1 of 1

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

Posted: Mon 31 Dec 2012, 16:31
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.

Making PDF's

Posted: Tue 01 Jan 2013, 01:19
by ndujoe1
I take the lazy man's option and create PDF's with Open office.

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

Posted: Tue 01 Jan 2013, 15:34
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)`

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

Posted: Tue 01 Jan 2013, 18:10
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.

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

Posted: Sun 13 Jan 2013, 22:18
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.

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

Posted: Tue 15 Jan 2013, 02:08
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?

Posted: Sat 26 Jan 2013, 23:07
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

Posted: Sat 26 Jan 2013, 23:23
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?

Posted: Tue 29 Jan 2013, 21:07
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: