From d4b404d3d9edc40631e8ceaddeb27da2eb276533 Mon Sep 17 00:00:00 2001
From: g0dil <g0dil@wiback.org>
Date: Fri, 20 Apr 2007 06:54:33 +0000
Subject: [PATCH] Added admin scripts to repository

---
 SConstruct             |  8 ++++---
 admin/build.sh         | 51 ++++++++++++++++++++++++++++++++++++++++++
 admin/dump.sh          | 17 ++++++++++++++
 senfscons/Dia2Png.py   |  4 ++--
 senfscons/Doxygen.py   |  9 ++++----
 senfscons/SENFSCons.py |  7 +++---
 6 files changed, 84 insertions(+), 12 deletions(-)
 create mode 100755 admin/build.sh
 create mode 100755 admin/dump.sh

diff --git a/SConstruct b/SConstruct
index 3d952f496..807596ac5 100644
--- a/SConstruct
+++ b/SConstruct
@@ -36,9 +36,11 @@ SConscript(glob.glob("*/SConscript"))
 
 SENFSCons.StandardTargets(env)
 SENFSCons.GlobalTargets(env)
-SENFSCons.Doxygen(env, extra_sources = [
-    'Examples/Sniffer/Sniffer.cc',
-])
+SENFSCons.Doxygen(env)
+
+#, extra_sources = [
+#    'Examples/Sniffer/Sniffer.cc',
+#])
 SENFSCons.DoxyXRef(env,
                    HTML_HEADER = '#/doclib/doxy-header-overview.html',
                    HTML_FOOTER = '#/doclib/doxy-footer.html')
diff --git a/admin/build.sh b/admin/build.sh
new file mode 100755
index 000000000..eba2421ec
--- /dev/null
+++ b/admin/build.sh
@@ -0,0 +1,51 @@
+#!/bin/sh -e
+
+cd /home/senf/src
+
+rm -f build.log ../upload.log
+touch build.log ../upload.log
+
+trap 'exec >/dev/null 2>&1; cat build.log ../upload.log 1>&3; exit 1' ERR
+
+exec 3>&1 >build.log 2>&1
+
+echo -n '# Starting build at '; date --utc
+
+if [ "$1" == "-c" ]; then
+    echo '$ find -mindepth 1 -maxdepth 1 ! -name .svn | xargs rm -rf'
+    find -mindepth 1 -maxdepth 1 ! -name .svn ! -name build.log | xargs rm -rf
+fi
+
+echo '$ svn update'
+svn update | tee ../svn-update.log
+if grep -qv '^At ' ../svn-update.log; then
+    echo '$ rm -f doc/html/html.stamp'
+    rm -f doc/html/html.stamp
+fi
+rm -f ../svn-update.log
+
+echo '$ scons -k all'
+scons -k all
+echo -n '# Build completed at '; date --utc
+
+exec >../upload.log 2>&1
+
+if [ "$1" == "-c" ]; then
+    cp build.log build-full.log
+fi
+
+echo -n '# Upload started at '; date --utc
+rsync -rzv --del --delete-excluded \
+	--filter="- .svn" \
+	--filter="+ */" \
+	--filter="+ *.html" \
+	--filter="+ *.css" \
+	--filter="+ *.png" \
+	--filter="+ *.php" \
+	--filter="+ *.log" \
+	--filter="- *" \
+	. g0dil@shell.berlios.de://home/groups/senf/htdocs/src
+echo -n '# Upload completed at '; date --utc
+
+exec >/dev/null 2>&1
+scp ../upload.log g0dil@shell.berlios.de:/home/groups/senf/htdocs/upload.log
diff --git a/admin/dump.sh b/admin/dump.sh
new file mode 100755
index 000000000..2ce15ac31
--- /dev/null
+++ b/admin/dump.sh
@@ -0,0 +1,17 @@
+#!/bin/sh -e
+#
+# Dump the complete subversion repository from berlios into the dumps/ folder
+
+target=`date +'%Y%m%d.dump.gz'`
+dumpdir=/home/senf/dumps
+log=/home/senf/dump.log
+keep=4
+
+###########################################################################
+
+trap 'exec >/dev/null 2>&1; cat $log 1>&3; exit 1' ERR
+exec 3>&1 >$log 2>&1
+
+cd $dumpdir
+ssh g0dil@svn.berlios.de "svnadmin dump /svnroot/repos/senf -r 1:HEAD | gzip" >$target
+ls | sort -r | sed -e "1,${keep}d" | xargs -r rm
diff --git a/senfscons/Dia2Png.py b/senfscons/Dia2Png.py
index c20e6c756..3e5f0fe87 100644
--- a/senfscons/Dia2Png.py
+++ b/senfscons/Dia2Png.py
@@ -19,7 +19,7 @@
 # \ingroup builder
 
 import os
-import SCons.Builder
+import SCons.Builder, SCons.Action
 
 def dia_getSize(env,source):
     size = None
@@ -39,7 +39,7 @@ def dia2png_generator(source, target, env, for_signature):
     if size[0] > env['DIA2PNGMAXWIDTH']:
         size[1] = size[1]*env['DIA2PNGMAXWIDTH']/size[0]
         size[0] = env['DIA2PNGMAXWIDTH']
-    return env.Action("$DIACOM -t png -s %dx%d -e $TARGET $SOURCE" % tuple(size))
+    return SCons.Action.Action("$DIACOM -t png -s %dx%d -e $TARGET $SOURCE" % tuple(size))
 
 Dia2Png = SCons.Builder.Builder(suffix = ".png",
                                 src_suffix = ".dia",
diff --git a/senfscons/Doxygen.py b/senfscons/Doxygen.py
index 8cd35dd68..562d5681a 100644
--- a/senfscons/Doxygen.py
+++ b/senfscons/Doxygen.py
@@ -96,6 +96,7 @@
 import os, sys, traceback
 import os.path
 import glob, re
+import SCons.Action
 from fnmatch import fnmatch
 
 EnvVar = re.compile(r"\$\(([0-9A-Za-z_-]+)\)")
@@ -295,8 +296,8 @@ def DoxyGenerator(source, target, env, for_signature):
 
    data = DoxyfileParse(env, source[0].abspath)
 
-   actions = [ env.Action("cd ${SOURCE.dir}  && TOPDIR=%s ${DOXYGEN} ${SOURCE.file}"
-                          % (relpath(source[0].dir.abspath, env.Dir('#').abspath),)) ]
+   actions = [ SCons.Action.Action("cd ${SOURCE.dir}  && TOPDIR=%s ${DOXYGEN} ${SOURCE.file}"
+                                   % (relpath(source[0].dir.abspath, env.Dir('#').abspath),)) ]
 
    # This will add automatic 'installdox' calls.
    #
@@ -335,9 +336,9 @@ def DoxyGenerator(source, target, env, for_signature):
          if args is not None and url:
             args.append("-l %s@%s" % ( os.path.basename(tagfile), url ))
       if args:
-         actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args))))
+         actions.append(SCons.Action.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args))))
 
-   actions.append(env.Action([ "touch $TARGETS" ]))
+   actions.append(SCons.Action.Action([ "touch $TARGETS" ]))
 
    return actions
 
diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py
index 2691664b1..e365e854d 100644
--- a/senfscons/SENFSCons.py
+++ b/senfscons/SENFSCons.py
@@ -23,7 +23,8 @@
 # All other functions are for internal use only.
 
 import os.path, glob
-import  SCons.Options, SCons.Environment, SCons.Script.SConscript, SCons.Node.FS, SCons.Defaults
+import SCons.Options, SCons.Environment, SCons.Script.SConscript, SCons.Node.FS
+import SCons.Defaults, SCons.Action
 
 ## \defgroup use Predefined Framework Configurators
 #
@@ -372,7 +373,7 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []):
         # references
         env.AddPostAction(
             docs,
-            env.Action("xsltproc --nonet -o %(target)s.temp %(template)s %(target)s && mv %(target)s.temp %(target)s"
+            SCons.Action.Action("xsltproc --nonet -o %(target)s.temp %(template)s %(target)s && mv %(target)s.temp %(target)s"
                        % { 'target': tagnode.abspath,
                            'template': os.path.join(basedir,"tagmunge.xsl") }))
 
@@ -380,7 +381,7 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []):
         xslfile = env.File(env['DOXY_HTML_XSL'])
         env.AddPostAction(
             docs,
-            env.Action(("for html in %s/*.html; do " +
+            SCons.Action.Action(("for html in %s/*.html; do " +
                         "    echo $$html;" +
                         "    sed -e 's/id=\"current\"/class=\"current\"/' $${html}" +
                         "        | tidy -ascii -q --show-warnings no --fix-uri no" +
-- 
GitLab