#! /bin/csh -f
umask 2


set v=2.0
set d=tango-${v}
set t=`date +%y.%m.%d`


echo build: running refreshing scripts
cd ${d}/sm
@create-xxx.csh
cd ../..


echo build: cleaning
find ${d} -name "*~" |xargs rm -f
find ${d} |xargs touch


echo build: moving data to temporary location
mv ${d}/data .
#mv ${d}/applets/sbwisdom .


if ( -e ${d}-old ) then
    echo build: registering updates
    dircmp -s -w128 ${d}-old ${d} >>dircmp-${v}.log
endif


echo build: backuping in ${d}-old
rm -rf ${d}-old
chmod go-rwx ${d}
mv ${d} ${d}-old
cp -R ${d}-old ${d}
chmod g=rwxs,o=rx ${d}


echo build: moving data back
mv data ${d}
#mv sbwisdom ${d}/applets


echo build: saving ${d}-old in ${d}-${t}.tar
tar cf ${d}-${t}.tar ${d}-old
gzip -f ${d}-${t}.tar
chmod 640 ${d}-${t}.tar.gz


echo build: done
exit 0


cd ${d}


echo build: exporting suite
export-suite.csh


echo build: exporting downloads
export-downloads.csh


#echo build: exporting data
#export-data.csh


#echo build: exporting apis
#export-apis.csh


cd ..


echo build: done


