[LEDE-DEV] Call defines for minifying scripting languages

Christian Schoenebeck christian.schoenebeck at gmail.com
Mon Oct 3 07:44:14 PDT 2016

I implemented something like this into Makefile of ddns-scripts (Openwrt-Package).
It removes all comments (except starting with "#."), leading whitespaces and blank lines during package build. The source at Github is fully commented.


Am 03.10.2016 um 16:00 schrieb Jan-Tarek Butt:
> On 10/03/16 13:14, Karl Palsson wrote:
>> Jan-Tarek Butt <tarek at ring0.de> wrote:
>>> Hi,
>>> My Idea ist to create calldefs to minify all scriptes there are
>>> interpreted by run time.
>>> As example see the mail "[PATCH] LuaSrcDiet call define for lua
>>> code Minifying".
>>> I plan to write also calldefs for shellscripts, python and
>>> perl.
>>> They brings vareous of features.
>>> 1. Reducing memory size on firmware images.
>> But will it? They're in the squashfs image, it's already been
>> demonstrated before that compressing things before can actually
>> have negative impacts.
> The minifing proces is on compile time so I cant see negative
> impacts for the squashfs.
>>> 2. Strip out all comments (which makes us able to do better
>>> code commenting) 3. and so on.
>>> One negative point will be there:
>>> the minified code an not realy human readable but if some one
>>> want to read this script or work on it on routers, they can
>>> easily copy the unminified script via scp.
>> This is a _massive_ downside IMO, and absolutely not something
>> that should be enabled by default. There's already far too much
>> undocumented/underdocumented internal behaviours of scripts and
>> processes in LEDE/OpenWrt, and minifying scripts and stripping
>> comments actively works to preserve that situation.
> Sorry I think I have formulated it wrong.
> Inside the git we can documented the code and while the compile
> process the comments will drop from all shellscrips who run the
> calldef in its makefile.
> so only on the finish compiled images are the minified scripts.
> and of cause this is optionaly and looks like this [0]. So you
> can just call ist inside the package Makefile.
> [0] https://lists.ffnw.de//pipermail/dev/2016-July/001444.html
> cheers
> Tarek

More information about the Lede-dev mailing list