DM Smith <[email protected]> writes:
> Can anyone point me to the code that does the zipping?
I use this script for updating modules in my local repos (and then later
rsync files to Xiphos repo when appropriate). It includes automatic
update of version stamps and setting InstallSize and creating *.zip.
Embellish to taste. As is, it is invoked with the name of the *.conf,
without ".conf" itself.
#!/bin/sh
for mod ; do
echo ================ "$mod" ================
#
for dir in /var/ftp/prv/hci /var/ftp/pub/sword ; do
if [ ! -r "$dir"/mods.d/"$mod".conf ] ; then
continue
fi
echo $dir
cd $dir
#
# new date strings in .conf.
#
data="`grep DataPath mods.d/\"$mod\".conf | \
sed -e 's;DataPath=./;;' -e 's;[a-z]\+$;;'`"
files="`find \"$data\" -type f | sort`"
vdate="`date +%y%m%d`"
svdate="`date +%Y-%m-%d`"
installsize="`( echo 0 ; ls -l $files | awk '{ print $5"+" }' ; echo p
) | dc`"
sed -i \
-e "s/^\(Version=[0-9]\)\.[^-]*$/\1.$vdate/" \
-e "s/^\(Version=.\+\)-.*$/\1-$vdate/" \
-e "s/^SwordVersionDate=.*$/SwordVersionDate=$svdate/" \
-e "s/^InstallSize=.*$/InstallSize=$installsize/" \
mods.d/"$mod".conf
#
# make new .conf summary.
#
rm -f mods.d.tar.gz
tar czvf mods.d.tar.gz mods.d/*.conf
#
# gen up fresh zip.
#
rm -f zip/"$mod".zip
zip zip/"$mod".zip mods.d/"$mod".conf $files
done
done
#
exit 0
_______________________________________________
sword-devel mailing list: [email protected]
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page