blob: 9101fb099bf9162680b54c1eaecdc9e50b0b48c5 [file] [log] [blame]
#!/usr/bin/sh
ct=/usr/atria/bin/cleartool
natdoc=/mnt/TTCN/Tools/naturaldocs/NaturalDocs
ttcn3=/view/${USER}_tcc/vobs/ttcn/TCC_Common/Libraries/EPTF_Applib_HTTP_CNL113618/src
natdocvobdir=$ttcn3/../test/EPTF_Applib_HTTP_NaturalDocs_Generator #to be excluded
natdocproj=$natdocvobdir/generated
html_dir=$natdocproj/html
# Prepare Files
prepare_file()
{
f=$1
if [ -w $f ]
then
$ct lscheckout -cview $f | grep unreserved
if [ $? ]
then
$ct unco -rm $f
else
echo "Warning - $f is checked out reserved!"
fi
fi
if [ ! -w $f ]
then
$ct co -c "Checked out by generate.sh" -unreserved $f
fi
if [ ! -w $f ]
then
echo "Error - unable to check out $f - check your config spec"
$ct ls $f
exit
fi
}
if [ ! -x $natdoc ]
then
echo "Error - Can't execute $natdoc"
exit
fi
# Check out those files that need to be modified, unreserved
#prepare_file "$natdocproj/Topics.txt"
#prepare_file "$natdocproj/Languages.txt"
cp $natdocvobdir/Topics.txt $natdocproj/Topics.txt
cp $natdocvobdir/Languages.txt $natdocproj/Languages.txt
cp $natdocvobdir/load.css $natdocproj/load.css
cp $natdocvobdir/Menu.txt $natdocproj/Menu.txt
chmod 664 $natdocproj/Topics.txt $natdocproj/Languages.txt $natdocproj/load.css #$natdocproj/Menu.txt
# Run from the top level directory
# NaturalDocs doesn't seem to update the menu properly without the hacking below
echo "Deleting cached info..."
#/usr/bin/rm -f $natdocproj/Menu.txt
/usr/bin/rm -f $natdocproj/Data/*
echo "Rebuilding everything..."
$natdoc --input $ttcn3 --output framedhtml $html_dir --project $natdocproj -s Default load -r --exclude-input $natdocvobdir
# Ensure that any new files created are writable by all, but ignore
# the errors that will probably come
chmod 775 `find $html_dir -type d` > /dev/null 2>&1
chmod 664 `find $html_dir -type f` > /dev/null 2>&1
chmod 664 `find $natdocproj/Data -type f` > /dev/null 2>&1
chmod 664 $natdocproj/Menu.txt > /dev/null 2>&1
/usr/bin/rm -f $natdocproj/Topics.txt
/usr/bin/rm -f $natdocproj/load.css
/usr/bin/rm -f $natdocproj/Languages.txt
# copy externally modified html files
#cp $natdocvobdir/TITANSim.html $html_dir/files/TITANSim.html
#cp $natdocvobdir/index.html $html_dir/index.html
# close group items for default
#/bin/sh closegroups.sh $html_dir/menu.html $html_dir/menu2.html
#/usr/bin/rm -f $html_dir/menu.html
#/usr/bin/mv $html_dir/menu2.html $html_dir/menu.html
# repairs unnatural html files generated by NaturalDocs
/usr/local/bin/perl /$natdocvobdir/repairunnaturalhtml.pl $html_dir