[nagiosplug] Update tools

"Nagios Plugin Development" <[email protected]> Sat, 3 Nov 2012 21:50:29 +0000
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
 Module: nagiosplug
 Branch: master
 Commit: d51f87cc797cdc34249878e49d19bb2c5a44d0e5
 Author: dermoth <[email protected]>
   Date: Sat Nov  3 22:01:37 2012 +0000
    URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=d51f87c

Update  tools

- fix sfwebcron (tool updating sf developer guidelines)
- remove obsolete snapshot script

---

 tools/sfwebcron |   23 +++++++++--------
 tools/snapshot  |   69 -------------------------------------------------------
 2 files changed, 12 insertions(+), 80 deletions(-)

diff --git a/tools/sfwebcron b/tools/sfwebcron
index d836a0f..c270cef 100755
--- a/tools/sfwebcron
+++ b/tools/sfwebcron
@@ -4,15 +4,16 @@
 # To update the developers-guidelines.html and put in html area
 #
 # Install in cron with something like:
-#  47 7 * * * $HOME/bin/sfwebcron
+#  47 7 * * * $HOME/bin/sfwebcron >/tmp/sfwebcron.log 2>&1 || cat /tmp/sfwebcron.log
 
-function die { echo $1; exit 1; }
+set -eu
+trap 'echo "Command failed at line $LINENO"' ERR
 
 # Set working variables
 PROJECT=nagiosplug
-IN=${HOME}/tmp_sfwebcron
-OUT_SERVER="[email protected]"
-OUT="/home/groups/n/na/nagiosplug/htdocs"
+IN=${HOME}/sfwebcron
+OUT_SERVER="[email protected]"
+OUT_PATH="/home/groups/n/na/nagiosplug/htdocs"
 
 if [[ ! -e developer-guidelines.html.last ]] ; then
 	touch developer-guidelines.html.last
@@ -21,15 +22,15 @@ fi
 # Get latest dev guildelines
 [[ ! -d $IN ]] && mkdir $IN
 cd $IN
-if [[ ! -d doc ]] ; then
-	#cvs -z3 -d:pserver:anonymous@cvs1:/cvsroot/nagiosplug co nagiosplug || die "Cannot cvs"
-	svn checkout http://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk/doc doc
+if [[ ! -d nagios-plugins ]] ; then
+	git clone https://github.com/nagios-plugins/nagios-plugins.git nagios-plugins
 fi
-cd doc
-svn update
+cd nagios-plugins/doc
+git pull
 
 make
 if [[ developer-guidelines.html -nt developer-guidelines.html.last ]] ; then
-	scp developer-guidelines.{html,sgml} $OUT_SERVER:$OUT
+	rsync -av developer-guidelines.{html,sgml} $OUT_SERVER:$OUT_PATH/
 	touch developer-guidelines.html.last
 fi
+
diff --git a/tools/snapshot b/tools/snapshot
deleted file mode 100755
index 9fa61cf..0000000
--- a/tools/snapshot
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-
-# This scipt assumes that you have anonCVS for nagios and nagiosplug
-# in ${IN}
-
-# cvs -d:pserver:[email protected]:/cvsroot/nagiosplug login
-# cvs -z3 -d:pserver:[email protected]:/cvsroot/nagiosplug co nagiosplug
-#
-# cvs -d:pserver:[email protected]:/cvsroot/nagios login
-# cvs -z3 -d:pserver:[email protected]:/cvsroot/nagios co nagios
-
-# Set directories
-IN=${HOME}/sf
-OUT=/col/htdocs/src/nagios
-RPM_TOPDIR=${HOME}/redhat
-
-# Update nagiosplug CVS
-cd ${IN}/nagiosplug
-rm configure configure.in Makefile.in
-cvs update
-DS=`date -u +%Y%m%d%H%M`
-sed "s/^VER=.*/VER=${DS}/;s/^REL=.*/REL=snapshot/" configure.in > configure.tmp
-mv configure.tmp configure.in
-aclocal
-autoheader
-autoconf
-automake
-autoreconf
-
-# Make the Nagiosplug dist tarball
-rm -r build-dist
-mkdir build-dist
-cd build-dist
-../configure
-make dist
-cp -fv *.gz ${OUT}
-
-# Make the Nagiosplug custom RPM
-echo "%_topdir ${RPM_TOPDIR}" > ./.rpmrc
-mkdir -p ${RPM_TOPDIR}/RPMS/i386 ${RPM_TOPDIR}/SRPMS ${RPM_TOPDIR}/SOURCES ${RPM_TOPDIR}/BUILD ${RPM_TOPDIR}/SPECS
-rpm --rcfile "/usr/lib/rpm/rpmrc:${IN}/rpmrc" --define 'custom 1' -ta *.gz
-cp -fv ~/redhat/RPMS/i386/nagios-plugins-custom-*.i386.rpm /col/htdocs/src/nagios
-
-# Copy the new snapshot and delete the old ones
-cd ${OUT}
-GLOBIGNORE=nagios-plugins-${DS}-snapshot.tar.gz
-rm -f nagios-plugins-*.tar.gz
-GLOBIGNORE=nagios-plugins-custom-${DS}-snapshot.i386.rpm
-rm -f nagios-plugins-custom-*-snapshot.i386.rpm
-cd ~/redhat/SRPMS
-rm nagios-plugins-custom-${DS}-snapshot.src.rpm
-cd ~/redhat/RPMS/i386
-rm nagios-plugins-custom-${DS}-snapshot.i386.rpm
-
-# Update Nagios CVS
-cd ${IN}/sf/nagios
-rm configure configure.in nagios.spec base/nagios.c common/common.h \
-	html/main.html Makefile.in
-cvs update
-
-# Make the Nagios tarball
-DS=`date -u +%Y%m%d%H%M`
-./make-tarball ${DS}
-
-# Copy the new snapshot and delete the old ones
-mv ../nagios-${DS}.tar.gz /col/htdocs/src/nagios/
-GLOBIGNORE=${OUT}/nagios-${DS}.tar.gz
-rm ${OUT}/nagios-20*.tar.gz
-


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d