The time now is Tue 21 May 2013, 03:22
All times are UTC - 4 |
|
Page 8 of 8 [110 Posts] |
Goto page: Previous 1, 2, 3, ..., 6, 7, 8 |
| Author |
Message |
MrDurtal

Joined: 22 Apr 2011 Posts: 7
|
Posted: Fri 02 Dec 2011, 09:03 Post subject:
Excellent source of help! |
|
Thanks very much for all of the effort.
MrDurtal
|
|
Back to top
|
|
 |
rhadon

Joined: 27 Mar 2008 Posts: 1228 Location: Germany
|
Posted: Wed 08 Feb 2012, 05:05 Post subject:
|
|
Hi,
I have a general question. I can write
| Code: | if ...condition...;then
do this...
fi
if not...condition...;then
do that...
fi |
or I can write
| Code: | if ...condition...;then
do this...
else
do that...
fi |
It looks to me that the last one is 'better style' but is it really better, maybe faster?
Concrete example, with slacko 5.3.2.1 in rcsysinit, ~line 754 is written:
| Code: | #save button on desktop when booted from flash drive...
if [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then #pup_rw is tmpfs.
if [ "`cat /root/Choices/ROX-Filer/PuppyPin | grep "save2flash"`" = "" ];then
echo '<icon x="768" y="128" label="save">/usr/sbin/save2flash</icon>' >> /root/Choices/ROX-Filer/PuppyPin
cat /root/Choices/ROX-Filer/PuppyPin | grep -v '/pinboard' > /tmp/PuppyPin-CPY
sync
cp -f /tmp/PuppyPin-CPY /root/Choices/ROX-Filer/PuppyPin
echo '</pinboard>' >> /root/Choices/ROX-Filer/PuppyPin
fi
fi |
I added:
| Code: | if ! [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then #pup_rw is tmpfs.
if ! [ "`cat /root/Choices/ROX-Filer/PuppyPin | grep "save2flash"`" = "" ];then
cat /root/Choices/ROX-Filer/PuppyPin | grep -v "^<icon x=\"768\" y=\"128\" label=\"save\"" >/tmp/PuppyPin-CPY
cp -f /tmp/PuppyPin-CPY /root/Choices/ROX-Filer/PuppyPin
echo '</pinboard>' >> /root/Choices/ROX-Filer/PuppyPin
fi
fi |
Is it worth to change?
Thanks,
Rolf
_________________ Ich verwende "frugal", und das ist gut so.
Raspberry Pi without Puppy? No, thanks.
|
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 7018 Location: qld
|
Posted: Wed 08 Feb 2012, 05:35 Post subject:
|
|
Hi Rolf.. | Quote: | | Is it worth to change? |
Probably yes!
But it's embedded in woof and getting upstream changes like that are difficult as there are always more pressing issues.
[One example is how gdk-pixbuf-query-loaders is run since gtk+2.20 , I tried to get Barry to change it to the correct call from what I researched but to no avail, I patch it every time I build slacko]
I would do it completely differently...
| Code: | case $PUPMODE in
3|7|13)
(code for whatever goes here)
;;
*)echo
;;
esac |
_________________ keep the faith .. 
|
|
Back to top
|
|
 |
rhadon

Joined: 27 Mar 2008 Posts: 1228 Location: Germany
|
Posted: Wed 08 Feb 2012, 08:43 Post subject:
|
|
Thanks Mick
I wasn't aware about '*)' in case...esac. Will give it a try.
I also know that it's only for one special version. If woof changes (I know it does often ), everything must be done again and maybe it doesn't work in newer versions or at least it must be changed. Too annoying to do it everytime. But a good feeling to be able to do so and it works. That's the fun.
Cheers
Rolf
_________________ Ich verwende "frugal", und das ist gut so.
Raspberry Pi without Puppy? No, thanks.
|
|
Back to top
|
|
 |
SkullyRipz
Joined: 02 Mar 2012 Posts: 24
|
Posted: Thu 29 Mar 2012, 23:35 Post subject:
|
|
Bruce...
... thank you. This is exactly what I needed. I appreciate all the time spent. Its very well put together and easy to follow.
_________________ Lucid 5.2.8 Frugal
|
|
Back to top
|
|
 |
|
|
Page 8 of 8 [110 Posts] |
Goto page: Previous 1, 2, 3, ..., 6, 7, 8 |
|
|
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
|