aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJ Pipkin <j@dawnrazor.net>2013-01-07 23:07:43 -0600
committerJ Pipkin <j@dawnrazor.net>2013-01-07 23:07:43 -0600
commitc67f7404d7af3ca1a3c36614204cfaa459313e08 (patch)
tree8c0eab9153ae771b2f5f9c02215051e4bd7c6d58 /tools
parent63ba7bfa84f3545110597a1a9c75335cd66b9ad8 (diff)
downloadsbotools-c67f7404d7af3ca1a3c36614204cfaa459313e08.tar.xz
added tools dir with htmlgen.sh and masstest_sbo.sh
Diffstat (limited to 'tools')
-rwxr-xr-xtools/htmlgen.sh49
-rwxr-xr-xtools/masstest_sbo.sh64
2 files changed, 113 insertions, 0 deletions
diff --git a/tools/htmlgen.sh b/tools/htmlgen.sh
new file mode 100755
index 0000000..70a8b88
--- /dev/null
+++ b/tools/htmlgen.sh
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+
+if [[ "$1" == "" || "$2" == "" ]]; then
+ echo "usage: $(basename $0) package version"
+ exit 1
+fi
+
+PACKAGE=$1
+VERSION=$2
+
+if [[ ! -d $HOME/$PACKAGE-$VERSION ]]; then
+ echo "I do not see the $PACKAGE-$VERSION directory."
+ exit 1
+fi
+
+SBO_DIR="$HOME/$PACKAGE-$VERSION"
+HTML_DIR="$HOME/html_man/$PACKAGE-$VERSION"
+mkdir -p $HTML_DIR
+
+for i in $(ls $SBO_DIR | grep '^man'); do
+ mkdir -p $HTML_DIR/$i
+ ( cd $SBO_DIR/$i
+ for j in $(ls); do
+ man2html $j > $j.html
+ mv $j.html $HTML_DIR/$i/
+ done
+ )
+ ( cd $HTML_DIR/$i
+ sed -i 's/^Content-type.*$//g' *
+ sed -i 's/^<A HREF.*Return to Main.*$//g' *
+ sed -i -r "s#http://localhost/cgi-bin/man/man2html\?([0-9])\+([^\"]+)#/$PACKAGE/documentation/\2\1#g" *
+ sed -i 's/j@dawnrazor.net/j_[at]_dawnrazor_[dot]_net/g' *
+ sed -i 's/xocel@iquidus.org/xocel_[at]_iquidus_[dot]_org/g' *
+ sed -i 's/<A HREF="mailto:xocel_\[at\]_iquidus_\[dot\]_org">//g' *
+ sed -i 's#\[dot\]_org</A>#[dot]_org#g' *
+ sed -i 's#<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>#man2html#g' *
+ sed -i 's/^$//g' *
+ sed -i 's/^<HTML><HEAD>.*$//g' *
+ sed -i 's#^</HEAD><BODY>$##g' *
+ for k in $(ls); do
+ mv $k $k.tmp
+ cat $k.tmp | awk "\$0 !~ /^$/ { print > \"$k\"; }"
+ rm $k.tmp
+ done
+ )
+done
+
+echo "All done."
+exit 0;
diff --git a/tools/masstest_sbo.sh b/tools/masstest_sbo.sh
new file mode 100755
index 0000000..478a848
--- /dev/null
+++ b/tools/masstest_sbo.sh
@@ -0,0 +1,64 @@
+#!/usr/bin/bash
+
+# set DISTCLEAN TRUE to preserve space
+sboconfig -d TRUE
+
+SBOS=$(find /usr/sbo -type f -iname \*.info | sed -r 's|.*/([^/]+)\.info$|\1|g');
+
+TLOG=~/tmp.log
+FLOG=~/fail.log
+ILOG=~/install.log
+RLOG=~/remove.log
+
+# zero out logs in case they have content from previous run
+:> $FLOG
+:> $ILOG
+:> $RLOG
+
+function build_things() {
+ if [ ! -z $1 ]; then
+ . /usr/sbo/*/$1/$1.info
+ for i in $REQUIRES; do
+ if [[ "$i" != "%README%" ]]; then
+ build_things $i
+ fi
+ done
+ echo "=============" > $TLOG
+ echo "sboupgrade -oNr $1" >> $TLOG
+ sboupgrade -oNr $i >> $TLOG 2>&1
+ if [[ $? != "0" ]]; then
+ echo "" >> $FLOG
+ cat $TLOG >> $FLOG
+ fi
+ echo "" >> $ILOG
+ cat $TLOG >> $ILOG
+ :> $TLOG
+ else
+ echo "build_things() requires an argument."
+ exit 1
+ fi
+}
+
+function remove_things() {
+ if [ ! -z $1 ]; then
+ echo "=============" > $TLOG
+ echo "sboremove --nointeractive $1" >> $TLOG
+ sboremove --nointeractive $1 >> $TLOG 2>&1
+ if [[ $? != 0 ]]; then
+ echo "" >> $FLOG
+ cat $TLOG >> $FLOG
+ fi
+ echo "" >> $RLOG
+ cat $TLOG >> $RLOG
+ :> $TLOG
+ fi
+}
+
+for i in $SBOS; do
+ echo $i
+ build_things $i
+ remove_things $i
+ removepkg $(ls /var/log/packages|grep SBo) > /dev/null 2>&1
+done
+
+exit 0