#!/bin/sh # This is a brute force script that updates the content tree with CVS data # and prints a fairly verbose report about what local files have been # modified. It also performs some really basic permissions maintenance # to accomodate the numerous methods people want to use to update content. DIR=/exp/public/public/messaging_6/docs REPORT=cvs_status.html # No User Servicable Parts Inside. # No Touching cd $DIR # This reirects STDOUT to a file. exec 1> $REPORT I=0 while [ $I -ne 1 ] do echo \ "
All your mods are belong to us.
CVS Status of doc root as of `date +"%H:%M:%S %d:%m:%Y"`
This is being determined by massaging the output of a
cvs -A -d update.
" cvs update -A -d | egrep -v "(cvs_status)" echo "" # Perform magic to determine number of modified files FILES=`egrep "^[?UPMCRA] " $REPORT | wc -l | awk '{print $1}'` if [ "$FILES" -lt 1 ] then echo "
The tree is in sync with CVS. Yay!
" I=1 else echo \ "If a document you just added to the doc tree has a question mark next to it then it is not yet in the CVS tree. See this page for information about how to add the document(s) to CVS. You needn't worry about other letters - I'll take care of them.
" I=1 fi done # My groups are slightly messed up. What is "wheel" on my machine is "staff" # elsewhere. Really. Don't mess with it. # Making sure that "nobody" and "staff" own the files ensures that people # that publish via Composer and NES can make mods if chown -R nobody:wheel * then echo \ "As part of the update I've changed the ownership of all the
files to nobody
, and the group to staff
.
Something broke during the update, however, and I was unable to chown the files. This needs attention.
" fi # Enabling the "write" bit makes sure that whatever else messed up method # people want to modify the docs won't be blocked if chmod -R a+w * then echo \ "I've also enabled the global \"write\" bit on all files to allow for the various methods of content updating.
" else echo \ "I wasn't able to enable the \"write\" bit on some files. That sucks.
" fi # I don't want .shtml docs to be modified without some amount of effort. # It's too easy to mess them up if care isn't taken. if chmod -R a-w project/master.shtml then echo \ "To keep accidents from happening I've disabled the \"write\" bit for the master.shtml document.
" else echo \ "I was unable to disable the \"write\" bit on master.shtml. I feel very not powerfull.
" fi # This closes the STOUT redirection exec 1>&-