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 Mon 01 Sep 2014, 09:39
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
PET scripts puzzler (solved)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
Sit Heel Speak


Joined: 30 Mar 2006
Posts: 2595
Location: downwind

PostPosted: Tue 04 Aug 2009, 03:46    Post subject:  PET scripts puzzler (solved)  

I am being thwarted in my quest to create a universal PET package to install BCI-hinting-enabled libfreetype, by just a single remaining bug. I can't see what's wrong and hope someone can help.

The implementation / architecture of the PET package, is as follows:

1. PPM unpacks sourcefiles into the two subdirs
--a. /usr/local/new_libfreetype
--b. /usr/local/new_fontconfig

2. PPM starts post-install script pinstall.sh, pinstall.sh does the following:
--a. Creates a subdir and copies existing libfreetype.s* into it (/usr/local/original_libfreetype)
--b. Creates a subdir and copies existing font config files into it (/usr/local/original_fontconfig)
--c. Creates a subdir and copies rc.local into it (/usr/local/original_libfreetype/original_rc_local)
--d. Copies from new_libfreetype, into /root/Startup, a bash script restore_original_rc_local
--e. Appends a line to rc.local for execution during next reboot. The line calls a script called run_upon_first_next_reboot.
--f. Calls up defaultbrowser with an advisory page on patents.
--g. calls up defaulttexteditor with a message assuring that all is OK and instructing to reboot.

3. Then, when the user reboots:
--a. The appended-to rc.local calls run_upon_first_next_reboot.
--b. run_upon_first_next_reboot copies the upgraded libfreetype libs into /usr/bin over the old ones, and upgraded font config files into /etc/fonts.
--c. X starts, and /root/Startup/restore_original_rc_local executes. restore_original_rc_local does the following:
--d. if a marker file (supplied in the source) is present, copies the original rc.local from its temporary stashplace /usr/local/original_libfreetype/original_rc_local back over the appended-to copy in /etc/rc.d.
--e. --and then deletes the marker file in /usr/local/new_libfreetype, so rc.local gets re-copied in only once.
--f. And finally, calls up defaulttexteditor with a congratulations notice.

It all works beautifully EXCEPT that in step 2c the pinstall.sh script is failing to create a copy of rc.local. Therefore, step 3d fails, and so at the end,...well,...the thrilled user has BCI-hinting-enabled freetype and is dazzled at the sharpness and glows with success, all right...but, rc.local still has the additional appended line. The extra line does no harm, because it can be made conditional, to execute only if the first-time-run marker file (gone after step 3e) is present, ...but for the sake of stylistic cleanness, the appended line shouldn't be there, i.e. the original rc.local should be copied back in.

Here is the snippet from pinstall.sh which is not obliging me:
Code:
# Create a backup of rc.local preparatory to the after-reboot portion of this installation:
if [ ! -d /usr/local/original_libfreetype ]; then
   mkdir /usr/local/original_libfreetype
   sync
fi
if [ ! -d /usr/local/original_libfreetype/original_rc_local ]; then
   mkdir /usr/local/original_libfreetype/original_rc_local
   sync
fi
if [! -f /usr/local/original_libfreetype/original_rc_local/rc.local ]; then
   cp -f /etc/rc.d/rc.local /usr/local/original_libfreetype/original_rc_local/rc.local
   sync
fi
Can anyone see why it's not making the desired copy of rc.local? Is there something special in the way Puppy handles rc.local?

TIA,
Philip

Last edited by Sit Heel Speak on Tue 04 Aug 2009, 20:07; edited 2 times in total
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11092
Location: The Peoples Republic of California

PostPosted: Tue 04 Aug 2009, 05:02    Post subject:  

To make your original backup
cp /etc/rc.d/rc.local /

Then see if it copied.

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Tue 04 Aug 2009, 13:02    Post subject:  

or maybe try
cp -ax
I sometimes need that instead of "cp", or a file does not get copied.
Mark

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2238

PostPosted: Tue 04 Aug 2009, 13:24    Post subject:  

You are missing a space between the bracket and !:
if [!
Back to top
View user's profile Send private message 
Sit Heel Speak


Joined: 30 Mar 2006
Posts: 2595
Location: downwind

PostPosted: Tue 04 Aug 2009, 18:42    Post subject:  

Shocked Rolling Eyes Smile Very Happy That does it. I'm switching to tea...

I must have looked at that snippet 50 times, and didn't see it. Amigo of course nailed it.

My thanks to all of you, you are mentioned in pinstall.sh. You'll get ten percent of any profit I make from it, too... Laughing

Now to go start populating that thread...
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0603s ][ Queries: 11 (0.0108s) ][ GZIP on ]