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 Thu 18 Dec 2014, 15:45
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Strip --strip-debug --strip-unneeded recursively
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
stemsee

Joined: 27 Jun 2013
Posts: 668
Location: London

PostPosted: Sat 02 Aug 2014, 08:30    Post subject:  Strip --strip-debug --strip-unneeded recursively
Subject description: how to
 

How to strip self compiled libs/apps for puppy.

Is there a magic script already in existence?

I have got this;


recursive strip command
Code:
find . -type f -print -exec strip --strip-debug {} \;


determine executale
Code:
 [ `stat -c %A someFile | sed 's/...\(.\).\+/\1/'` == "x" ] 


I need to add code to find executables and strip unneeded, other files strip debug.

I guess
Code:
find . -type f -name '*' |  [ `stat -c %A * | sed 's/...\(.\).\+/\1/'` == "x" ] | $strip
case $strip in
         x) strip --strip-unneeded
         *) strip --strip-debug
esac


Any advice welcome?
Back to top
View user's profile Send private message MSN Messenger 
jamesbond

Joined: 26 Feb 2007
Posts: 2232
Location: The Blue Marble

PostPosted: Sat 02 Aug 2014, 09:53    Post subject:  

I strip --strip-unneeded all files. I don't bother to check for filetypes - strip does it anyway Very Happy
_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 668
Location: London

PostPosted: Sat 02 Aug 2014, 14:00    Post subject:  

ok cheers!
Back to top
View user's profile Send private message MSN Messenger 
Karl Godt


Joined: 20 Jun 2010
Posts: 3982
Location: Kiel,Germany

PostPosted: Sat 13 Sep 2014, 22:20    Post subject:  

Somehow
strip --debug
on libs as
new2dir
script does,
does not work for me since a longer while .

I use strip on both exes and libs . No problem with that .

_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send private message Visit poster's website 
Ibidem

Joined: 25 May 2010
Posts: 527
Location: State of Jefferson

PostPosted: Mon 15 Sep 2014, 02:24    Post subject: Re: Strip --strip-debug --strip-unneeded recursively
Subject description: how to
 

stemsee wrote:
How to strip self compiled libs/apps for puppy.
Is there a magic script already in existence?
I have got this;

recursive strip command
Code:
find . -type f -print -exec strip --strip-debug {} \;


determine executale
Code:
 [ `stat -c %A someFile | sed 's/...\(.\).\+/\1/'` == "x" ] 


I need to add code to find executables and strip unneeded, other files strip debug.

I guess
Code:
find . -type f -name '*' |  [ `stat -c %A * | sed 's/...\(.\).\+/\1/'` == "x" ] | $strip
case $strip in
         x) strip --strip-unneeded
         *) strip --strip-debug
esac


Any advice welcome?

I suppose the following isn't needed, since --strip-unneeded works everywhere. But it may be interesting for shell scripts.

find also supports -perm [-]mode.
-name '*' is always implied.
This lets you implement the above as
Code:
find . -type f -exec strip --strip-debug '{}' \;
find . -type f -mode -u+x -exec strip --strip-unneeded '{}' \;


(note that --strip-debug is a subset of --strip-unneeded, so it isn't harmful to do both).

Another option is using a shell script that calls 'test' (the [ ] in so many shell scripts).
Eg:
Code:
#!/bin/sh
test  -w "$1" -a  -s "$1" || exit 1 #no strip if readonly or empty
if test -x "$1"
  then
     strip --strip-unneeded "$1"
  else
     strip --strip-debug "$1"
fi

Above is to be called by
Code:
find -exec scriptname '{}' \;
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3435
Location: Ontario

PostPosted: Mon 15 Sep 2014, 17:57    Post subject:  

I use Iguleder's tools which require devx package to be installed.

http://www.murga-linux.com/puppy/viewtopic.php?t=58331
________________________________________________________
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 668
Location: London

PostPosted: Thu 18 Sep 2014, 05:21    Post subject:  

Thanks for everyone's input. With all of these options available it seems time for a unifying script to implement various combinations of these stripping commands.
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0736s ][ Queries: 12 (0.0046s) ][ GZIP on ]