[Blends-commit] [SCM] website branch, master, updated. 91650bee5cd28d264b319cc05afbe6325c49efdf

Andreas Tille tille at debian.org
Wed Dec 11 21:43:51 UTC 2013


The following commit has been merged in the master branch:
commit 91650bee5cd28d264b319cc05afbe6325c49efdf
Author: Andreas Tille <tille at debian.org>
Date:   Wed Dec 11 22:43:06 2013 +0100

    Add script that verifies all Vcs repositories and checks md5sum of tasks files about changes

diff --git a/webtools/check-all-tasks b/webtools/check-all-tasks
new file mode 100755
index 0000000..f87209b
--- /dev/null
+++ b/webtools/check-all-tasks
@@ -0,0 +1,94 @@
+#!/bin/sh -e
+
+: <<=cut
+
+=head1 NAME
+
+check-all-tasks - check whether there are changes of tasks files in Vcs
+
+=head1 SYNOPSIS
+
+check-all-tasks
+
+=head1 DESCRIPTION
+
+This script checks whether there is any need to update web sentinel
+pages.  It checkout / clones the relevant repositories that are
+mentioned in the according config file in `pwd`/webconf.
+
+=cut
+
+if [ "--help" = "$1" -o "-h" = "$1" ] ; then
+	pod2man --center "Debian Blends Documentation" check-all-tasks  | nroff -man
+	exit 1
+fi
+
+cd `dirname $0`
+
+for bc in `ls webconf/*.conf | grep -v -e "webconf/fun\." -e rest-test` ; do
+    blend=`basename ${bc} .conf`
+    # echo "----- $blend ------"
+    datadir=`grep "^DataDir:" ${bc} | sed 's/^DataDir:\s*//'`
+    vcsurl=`grep "^VcsDir:" ${bc} | sed 's/^VcsDir:\s*//'`
+    vcstype=`echo ${vcsurl} | sed 's/^\([a-z]\{3\}\):.*/\1/'`
+    if [ "$vcstype" != "git" -a "$vcstype" != "svn" ] ; then
+        if echo ${vcsurl} | grep '^http://github' ; then
+            vcstype=git
+        else
+            vcstype=unknown
+            echo "Unknown VcsType ${vcstype} in VcsURL ${vcsurl}"
+        fi
+    fi
+    [ ! -d `dirname ${datadir}` ] && mkdir -p `dirname ${datadir}`
+    curdir=`pwd`
+    md5file="../${blend}.md5"
+    if [ ! -d ${datadir} ] ; then
+        if [ "${vcstype}" = "git" ] ; then
+            cd `dirname ${datadir}`
+            git clone ${vcsurl}
+        else if [ "${vcstype}" = "svn" ] ; then
+                mkdir -p ${datadir}
+                cd ${datadir}
+                svn checkout ${vcsurl}/debian
+                svn checkout ${vcsurl}/tasks
+            fi
+        fi
+    fi
+    if [ ${vcsurl} != "unknown" ] ; then
+        cd ${datadir}
+        # echo "vcs clone of ${vcsurl} exists in ${datadir}"
+        if [ "${datadir}" = "" ] ; then
+            echo "datadir is empty"
+            echo ${vcsurl}
+    	    exit 1
+        fi
+        if [ "${vcstype}" = "git" ] ; then
+            git pull
+        else if [ "${vcstype}" = "svn" ] ; then
+                cd tasks
+                svn up
+                cd ..
+            else
+                echo "Unknown VcsType ${vcstype} in VcsURL ${vcsurl}"
+            fi
+        fi
+        if [ ! -e ${md5file} ] ; then
+    	    cat `find tasks -mindepth 1 -maxdepth 1 -type f | sort` | md5sum > ${md5file}
+        else
+            mv ${md5file} ${md5file}.old
+    	    cat `find tasks -mindepth 1 -maxdepth 1 -type f | sort` | md5sum > ${md5file}
+    	    if ! diff ${md5file} ${md5file}.old >/dev/null ; then
+    		echo "Difference in tasks files of Blend ${blend}"
+    		cd $curdir
+                if ! ps aux | grep -v "0:0[0-9] grep " | grep -v "0:0[0-9] ps " | grep tasks.py ; then
+                    ./tasks.py ${blend}
+                fi
+    		if ! ps aux | grep -v "0:0[0-9] grep " | grep -v "0:0[0-9] ps " | grep thermometer.py ; then
+                    ./thermometer.py ${blend}
+                fi
+    	    fi
+        fi
+    fi
+    cd $curdir
+done
+

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list