From a5294ea7d40d3370e8e29cee57dd48baf5fad4da Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 15 Sep 2017 01:22:03 +0000 Subject: Add doxygen publishing scripts. --- doxygen/builder/rtems-doxygen-download | 100 +++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100755 doxygen/builder/rtems-doxygen-download (limited to 'doxygen/builder/rtems-doxygen-download') diff --git a/doxygen/builder/rtems-doxygen-download b/doxygen/builder/rtems-doxygen-download new file mode 100755 index 0000000..f72e2e1 --- /dev/null +++ b/doxygen/builder/rtems-doxygen-download @@ -0,0 +1,100 @@ +#! /bin/sh +# +# RTEMS Documentation Project +# +# Copyright 2017 Chris Johns +# All rights reserved +# +# Public domain +# + +# +# Exit on error. +# +set -e + +# +# Executables +# +cp=/bin/cp +diff=/usr/bin/diff +grep=/usr/bin/grep +mkdir=/bin/mkdir +rm=/bin/rm +sed=/usr/bin/sed + +# +# We run where the script is located. +# +cd $(dirname $0) + +# +# Top directory +# +top=$PWD + +# +# The current directory. +# +wwwdocs=/data/www/docs.rtems.org/doxygen/branches + +# +# Handover path. +# +handover=/data/ftp/pub/rtems/people/chrisj/docs.rtems.org/doxygen + +# +# Latest files. +# +latest_tags=rtems-doxygen-latest-tags +latest_doxygen=rtems-doxygen-latest.tar.gz + +# +# Current tags. +# +current_tags=${wwwdocs}/.tags + +# +# If no update directory create it. +# +if [ ! -d latest ]; then + ${rm} -rf latest + ${mkdir} latest +fi + +cd latest + update=no + # + # Download the latest tags and compare the branches in the package with the + # current tags. + # + if [ -f ${handover}/${latest_tags} ] && [ -f ${handover}/${latest_doxygen} ]; then + ${cp} ${handover}/${latest_tags} ${latest_tags} + if [ -f ${current_tags} ]; then + exec 3<& 0 + exec 0< ${latest_tags} + while read line + do + branch=$(echo ${line} | ${sed} -e 's/[[:space:]].*//g') + latest_hash=$(echo ${line} | ${sed} -e 's/.*[[:space:]]//g') + current_hash=$(cat ${current_tags} | ${grep} ${branch} | ${sed} -e 's/.*[[:space:]]//g') + if [ "${latest_hash}" != "${current_hash}" ]; then + update=yes + fi + done + else + update=yes + fi + if [ ${update} = yes ]; then + ${rm} -rf current + ${cp} -r ${wwwdocs} current + ${cp} ${handover}/${latest_doxygen} ${latest_doxygen} + set +e + ../rtems-doxygen-unpack-branches + set -e + fi + ${rm} -f ${latest_tags} + fi + cd .. + +exit 0 -- cgit v1.2.3