summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/dist/s_release_docs
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2014-11-04 15:46:40 -0500
committerEliot Horowitz <eliot@10gen.com>2014-11-05 11:21:19 -0500
commit5ca2daf551a2c631a5f573cb054406f5d49fbef5 (patch)
treeb0a23d34ffdb376bac0b79ed17b5619cfc0d9b47 /src/third_party/wiredtiger/dist/s_release_docs
parent017704acdfc7517efadb3fab167bba06c025c01a (diff)
downloadmongo-5ca2daf551a2c631a5f573cb054406f5d49fbef5.tar.gz
SERVER-15953: add wiredtiger to third_party
Diffstat (limited to 'src/third_party/wiredtiger/dist/s_release_docs')
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_release_docs79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/dist/s_release_docs b/src/third_party/wiredtiger/dist/s_release_docs
new file mode 100755
index 00000000000..965f59662e8
--- /dev/null
+++ b/src/third_party/wiredtiger/dist/s_release_docs
@@ -0,0 +1,79 @@
+#!/bin/sh
+# Build a WiredTiger release package.
+
+set -e
+
+. ../RELEASE_INFO || exit 1
+
+TOPDIR=`pwd`/..
+RELEASE_DIR=$TOPDIR/releases
+DOC_DIR=$TOPDIR/../wiredtiger.github.com
+DOCFILE=$TOPDIR/src/docs/top/main.dox
+tmp=$0.tmp
+
+RELEASE_PACKAGE=`ls $RELEASE_DIR | tail -n 1`
+
+# Parse command line options.
+while getopts d:r: OPT; do
+ case "$OPT" in
+ d)
+ DOC_DIR=$OPTARG
+ ;;
+ r)
+ RELEASE_PACKAGE=$OPTARG
+ ;;
+ \?)
+ # getopts issues an error message
+ echo $USAGE >&2
+ exit 1
+ ;;
+ esac
+done
+
+# Remove the switches we parsed above.
+shift `expr $OPTIND - 1`
+
+if [ ! -d "$DOC_DIR" ]; then
+ echo "Invalid Git doc repository $DOC_DIR"
+fi
+if [ ! -f "$RELEASE_DIR/$RELEASE_PACKAGE" ]; then
+ echo "Invalid release package: $RELEASE_DIR/$RELEASE_PACKAGE"
+fi
+
+pkgver="$WIREDTIGER_VERSION"
+
+# Find the old versions in the documentation.
+oldrel=`grep current $DOCFILE | cut -d ' ' -f 2 | cut -d '<' -f 1`
+prevrel=`grep previous $DOCFILE | cut -d ' ' -f 2 | cut -d '<' -f 1`
+
+OLD_VERSION_MAJOR=`echo $oldrel | cut -d '.' -f 1`
+OLD_VERSION_MINOR=`echo $oldrel | cut -d '.' -f 2`
+OLD_VERSION_PATCH=`echo $oldrel | cut -d '.' -f 3`
+PREV_VERSION_MAJOR=`echo $prevrel | cut -d '.' -f 1`
+PREV_VERSION_MINOR=`echo $prevrel | cut -d '.' -f 2`
+PREV_VERSION_PATCH=`echo $prevrel | cut -d '.' -f 3`
+
+# Update the release versions on the landing page.
+sed -e "s/$oldrel/$pkgver/" $DOCFILE > $tmp && mv $tmp $DOCFILE
+if [ $OLD_VERSION_MINOR != $WIREDTIGER_VERSION_MINOR ]; then
+ sed -e "s/$prevrel/$oldrel/" $DOCFILE > $tmp && mv $tmp $DOCFILE
+fi
+
+echo "Rebuild documentation root"
+(cd "$TOPDIR/dist" && sh s_docs -l > /dev/null)
+
+# Copy the new files into the documentation repository
+(cd $TOPDIR && cp docs/top/* $DOC_DIR/)
+
+# Unpack the documentation into the right location
+(mkdir -p $DOC_DIR/$pkgver && cd $RELEASE_DIR && \
+ cp $RELEASE_PACKAGE $DOC_DIR/releases/ &&
+ tar xjf $RELEASE_PACKAGE -C $DOC_DIR/$pkgver --strip-components 2 wiredtiger-$pkgver/docs)
+
+(cd $DOC_DIR && git add . $pkgver releases/wiredtiger-$pkgver.tar.bz2 && \
+ git commit -m "Release $pkgver")
+
+echo "Finished packaging documentation, you should now push the results. Run:"
+echo "cd $DOC_DIR && git push origin"
+echo "To backout changes run 'git reset HEAD~1'"
+