| Author |
Message |
Moose On The Loose

Joined: 24 Feb 2011 Posts: 280
|
Posted: Mon 31 Dec 2012, 12:31 Post subject:
Pdf-writer doesn't work right on 528 full install |
|
file: usr/lib/cups/backend/pdf-writer
at line: 69
| Code: |
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.
|
|
Back to top
|
|
 |
ndujoe1
Joined: 04 Dec 2005 Posts: 616
|
Posted: Mon 31 Dec 2012, 21:19 Post subject:
Making PDF's |
|
I take the lazy man's option and create PDF's with Open office.
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Tue 01 Jan 2013, 11:34 Post subject:
Re: Pdf-writer doesn't work right on 528 full install |
|
| 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: |
PUPPY_LINUX=`uname -a | grep -ic $(hostname)`
|
|
|
Back to top
|
|
 |
Moose On The Loose

Joined: 24 Feb 2011 Posts: 280
|
Posted: Tue 01 Jan 2013, 14:10 Post subject:
Re: Pdf-writer doesn't work right on 528 full install |
|
| 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: |
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.
|
|
Back to top
|
|
 |
woodenshoe
Joined: 17 Nov 2012 Posts: 6 Location: Wisconsin
|
Posted: Sun 13 Jan 2013, 18:18 Post subject:
Re: Pdf-writer doesn't work right on 528 full install |
|
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: |
--- 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.
|
|
Back to top
|
|
 |
Moose On The Loose

Joined: 24 Feb 2011 Posts: 280
|
Posted: Mon 14 Jan 2013, 22:08 Post subject:
Re: Pdf-writer doesn't work right on 528 full install |
|
| 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: |
--- 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?
|
|
Back to top
|
|
 |
rerwin

Joined: 24 Aug 2005 Posts: 1318 Location: Maine, USA
|
Posted: Sat 26 Jan 2013, 19:07 Post subject:
|
|
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: | | [ -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: | #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, 19:41; edited 1 time in total
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Sat 26 Jan 2013, 19:23 Post subject:
|
|
With all due respect, why is this an issue? Under what circumstances would pdf-writer be run where the host computer was NOT Puppy?
|
|
Back to top
|
|
 |
woodenshoe
Joined: 17 Nov 2012 Posts: 6 Location: Wisconsin
|
Posted: Tue 29 Jan 2013, 17:07 Post subject:
|
|
| Quote: | | 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.
|
|
Back to top
|
|
 |
|