summaryrefslogtreecommitdiff
path: root/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh')
-rw-r--r--web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh
new file mode 100644
index 0000000..62ac513
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+# Handle cvs updates. This script looks at
+# /usr/local/to-update/
+# where the
+# /var/www/new-savannah-project/new.py
+# script creates empty files if there is work to do.
+#
+# Ward Vandewege, 2012-09-26
+
+DIR="/usr/local/to-update/"
+RUNUSER="wwwcvs"
+
+CHECKOUT="/var/www/savannah-checkouts"
+LOGFILE="/var/log/wwwcvs/update-cvs.log"
+
+if [[ "$(whoami)" != "$RUNUSER" ]]; then
+ echo "Script must be run as user: $RUNUSER"
+ exit -1
+fi
+
+if [[ -e $DIR/www ]]; then
+ cd /var/www
+ echo `date` >> $LOGFILE
+ echo "www: Beginning checkout" >> $LOGFILE
+ /usr/bin/cvs update -Pd . >> $LOGFILE 2>&1
+ rm -f $DIR/www
+ echo "www: CVS checkout completed" >> $LOGFILE
+fi
+
+for f in `ls $DIR`; do
+ NEXT=`expr index "$f" '___'`
+ if [[ "$NEXT" == "0" ]]; then
+ continue
+ fi
+
+ arr=`echo $f | tr -s "___" ' '`
+ T=''
+ for x in $arr; do
+ if [[ "$T" == '' ]]; then
+ T=$x
+ else
+ P=$x
+ fi
+ done
+
+ cd $CHECKOUT/$T
+ echo `date` >> $LOGFILE
+ echo "$P: Beginning checkout (type $T)" >> $LOGFILE
+ if [[ ! -d $P ]]; then
+ # Cf. RT #816041. This is lunacy. Ward, 2013-03-28.
+ mkdir $P
+ fi
+ /usr/bin/cvs -d :pserver:anoncvs@cvs.savannah.gnu.org:/webcvs/$P checkout -P $P >> $LOGFILE 2>&1
+ echo "$P: CVS checkout completed (type $T)" >> $LOGFILE
+ rm -f $DIR/$f
+
+done