[sword-devel] *.conf qualifier, InstallSize

DM Smith dmsmith555 at yahoo.com
Sat Dec 29 16:59:30 MST 2007

On Dec 29, 2007, at 4:43 PM, Karl Kleinpaste wrote:

> Chris Little <chrislit at crosswire.org> writes:
>> Personally, I have no interest in updating all of the  
>> existing .confs to
>> add the install size, and have no desire to do it on an ongoing  
>> basis as
>> part of the release process. If we can add it as an automated  
>> process,
>> that's fine/great.
> First-round fix-up, just cut-n-paste this after cd'ing to $SWORD_PATH:
> for mod in mods.d/*.conf ; do
>    echo InstallSize=1 >> $mod
>    data="`grep ^DataPath= \"$mod\" | sed -e 's;DataPath=./;;' -e 's; 
> [a-z]\+$;;'`"
>    files="`find \"$data\" -type f`"
>    installsize="`cat $files | wc -c`"
>    sed -i -e "s/^InstallSize=.*$/InstallSize=$installsize/" "$mod"
> done
> Take out the echo from the core of that to apply it as-is to any  
> update.

My opinion:

While the transport can compute it, the value only changes when the  
module changes. And requiring the transport mechanism to compute it  
does not make it available offline. Caching it in the conf makes good  
sense especially if it can be maintained easily (as in a script).

I think that Karl's script or a variant of it could easily be added at  
the beginning of the script that creates mods.d.tar.gz,

But, I'd suggest using something that doesn't read the entire file to  
get the size.

More information about the sword-devel mailing list