DSL Tips and Tricks :: Recursive-strip C comments



Quote (mikshaw @ Dec. 08 2007,04:54)
The final product can easily be reduced with the strip command.
Yes, but:
Actually, I was thinking about extensions like 'gcc1-with-libs.unc' or any '-dev.{dsl|unc}' extension. Basically, any extension that contains a large amount of header files can be drastically reduced in size.
For example, 'libwxgtk1-dev.uci' currently in 'mydsl/testing' is 804K. By stripping comments from all headers and scripts, the size is 368K.

Firefox and other programs which use XML can also benefit greatly
Quote
Actually, I was thinking about extensions like 'gcc1-with-libs.unc' or any '-dev.{dsl|unc}' extension. Basically, any extension that contains a large amount of header files can be drastically reduced in size.
Yes, I know that's exactlty what you meant, as did I. Those headers are used to build software beyond just "configure, make, make install", and often those comments are the *only* documentation available on how to use them. I guess I exaggerated that particular issue, though. A person wanting to know what those comments are could just as easily find a full copy of a particular header online. The savings in filesize are well worth the effort.

HOWEVER,
You will need to make sure that your script doesn't strip out copyright notices and license texts if you plan to distribute a stripped header package. That in itself may be your biggest challenge, considering a notice typically looks like any other comment and are often found in individual headers rather than just a README file..

Is this only to save space for the compressed tarballs?... or to pack more in the RamDisk when running the LiveCD version?

Is there such a thing as a compressed folder (a la NTFS) that could be used for savings in RamDisk?

If it's for the tarball sizes (uci sizes), how much difference does it make after compression?  An unstripped xyz is how much bigger than a stripped xyz after it's compressed?

Quote (mikshaw @ Dec. 08 2007,16:51)
HOWEVER,
You will need to make sure that your script doesn't strip out copyright notices and license texts if you plan to distribute a stripped header package. That in itself may be your biggest challenge, considering a notice typically looks like any other comment and are often found in individual headers rather than just a README file..
Yes, I agree. That does seem to be a requirement of distributing any source code.
To quote a section of the GNU General Public License (GPL):
Quote
4. Conveying Verbatim Copies.

You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.

You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
However, hypothetical question: Can the term "copy" above refers to, in our case, the MyDSL extension as a whole, or does it refers to each and every file in the source code?
To answer my own question: "keep intact all notices" seems to mean that all copyright headings must be kept as they are.
I have a wishful thought: Can we reduce this requirement
Quote
keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty
to a single notice (e.g. files called 'LICENSE' and 'WARRANTY') and remove the notices from the source code?
Yes, I know -- that would contradict "keep intact all", so I cannot do that. Just a wishful thought, though.

Next Page...
original here.