Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 14:15
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
Pdf-writer doesn't work right on 528 full install
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: 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
View user's profile Send_private_message 
ndujoe1

Joined: 04 Dec 2005
Posts: 700

PostPosted: 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
View user's profile Send_private_message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9203
Location: Stratford, Ontario

PostPosted: 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
View user's profile Send_private_message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: 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
View user's profile Send_private_message 
woodenshoe

Joined: 17 Nov 2012
Posts: 8
Location: Wisconsin

PostPosted: 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
View user's profile Send_private_message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: 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
View user's profile Send_private_message 
rerwin


Joined: 24 Aug 2005
Posts: 1529
Location: Maine, USA

PostPosted: 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
Edited_time_total
Back to top
View user's profile Send_private_message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9203
Location: Stratford, Ontario

PostPosted: 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
View user's profile Send_private_message 
woodenshoe

Joined: 17 Nov 2012
Posts: 8
Location: Wisconsin

PostPosted: 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. Wink
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0729s ][ Queries: 12 (0.0050s) ][ GZIP on ]