DSL Tips and Tricks :: Recursive-strip C comments



A good way to skip #! statements in sed is to not skip them. In fact, change them twice. Add:
Code Sample
-e /'#!'/s//"STRING THAT WON'T MATCH OTHER SED STATEMENTS"/

before any other sed statements/commands, then add"
Code Sample
-e /"STRING THAT WON'T MATCH OTHER SED STATEMENTS"/s//'#!'/


The sed "b" or Branch command would work too, but that can only be used in sed scripts/commandlists (I think).

Hi chaostic:
Thanks alot for the very helpful information. :)

Quote (WDef @ Dec. 18 2007,18:13)
Hi s_i,

I could be missing something but I don't quite follow why you want to do this sort of  thing to uci/unc files at all.  They don't use ramdisk.  In particular, running scripts to prune header files seems risky to me.  You only have to inadvertently bork one character to break the header for some build.

Personally I think it's better to leave all files in these two extension types alone.  I don't prune them at all, and like to be able to find the readmes etc in these extensions and often refer to them.  It only means a bigger download.  Leaving the files in place also can  provide dependency headers and libs ready to use for compiling an upgrade,  and might provide useful evidence about the source of problems with an extension.

And I'm not sure I trust stripped binaries unless the build does it for you anyway, but maybe that's not entirely rational ...?  I suppose a stripped binary may have a smaller footprint once loaded into memory.

Pruning is a good idea for .dsl extensions, so you can apply all of these techniques to that extension type.

I can see there is a type of aesthetic pleasure in getting a package size down for its own sake though?

Hi WDef:
My apologies -- I totally missed your post and didn't read it until just now.

Firstly, thanks for the very well-thought-out reply.
I agree with everything you said, especially what you said concerning README files. I mean, most of the time, no one reads them, except in those situations where you really can't figure out how to use the software, which is when they can really save you a lot of time. Also, I just thought of an important factor: People who are on dial-up are not so keen to hunt for docs online.
So, I think I will try to put README files in extensions.

Also: Yes, I agree that there is an aesthetic pleasure solely in reducing the package size. But the real Big Idea is to have the whole distro working altogether, that is to say, all the little pieces working together.

Go for it stupid_idiot! (I still feel a little strange typing your nic).  As it happens I've just stripped gnupg2 in a version update to gnupg2.uci, and halved its size.   But I'm still leaving the dependencies and headers etc  in there intact; these made it so very easy to compile and build the update (5 mins work max).  And also because gnupg2 is still somewhat of a mystery ...

original here.