From c41ecef0f9f8d9b7e70bc411327f693ba85d6596 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Wed, 13 Sep 2017 22:34:28 +0000 Subject: Change the handover path to support doxygen. --- docs/builder/rtems-docs-download | 55 +++++++++++++++++++++------------------- docs/builder/rtems-docs-upload | 24 ++++++++++++++++-- 2 files changed, 51 insertions(+), 28 deletions(-) diff --git a/docs/builder/rtems-docs-download b/docs/builder/rtems-docs-download index e2b78a2..22a608f 100755 --- a/docs/builder/rtems-docs-download +++ b/docs/builder/rtems-docs-download @@ -39,9 +39,9 @@ top=$PWD wwwdocs=/data/www/docs.rtems.org/branches # -# Upload URL. +# Handover path. # -docsurl=/data/ftp/pub/rtems/people/chrisj/docs.rtems.org/latest +handover=/data/ftp/pub/rtems/people/chrisj/docs.rtems.org/docs # # Current tags. @@ -62,31 +62,34 @@ cd latest # Download the latest tags and compare the branches in the package with the # current tags. # - ${cp} ${docsurl}/rtems-docs-latest-tags rtems-docs-latest-tags - if [ -f ${current_tags} ]; then - exec 3<& 0 - exec 0< rtems-docs-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 + if [ -f ${handover}/rtems-docs-latest-tags ] && \ + [ -f ${handover}/rtems-docs-latest.tar.xz ]; then + ${cp} ${handover}/rtems-docs-latest-tags rtems-docs-latest-tags + if [ -f ${current_tags} ]; then + exec 3<& 0 + exec 0< rtems-docs-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 /data/www/docs.rtems.org/branches current + ${cp} ${handover}/rtems-docs-latest.tar.xz rtems-docs-latest.tar.xz + set +e + ../rtems-docs-unpack-branches + set -e + fi + ${rm} -f rtems-docs-latest-tags fi - if [ ${update} = yes ]; then - ${rm} -rf current - ${cp} -r /data/www/docs.rtems.org/branches current - ${cp} ${docsurl}/rtems-docs-latest.tar.xz rtems-docs-latest.tar.xz - set +e - ../rtems-docs-unpack-branches - set -e - fi - ${rm} -f rtems-docs-latest-tags cd .. exit 0 diff --git a/docs/builder/rtems-docs-upload b/docs/builder/rtems-docs-upload index 7c217b3..a1b0809 100755 --- a/docs/builder/rtems-docs-upload +++ b/docs/builder/rtems-docs-upload @@ -18,6 +18,11 @@ set -e # mkdir=/bin/mkdir +# +# Handover path. +# +handover=/data/ftp/pub/rtems/people/chrisj/docs.rtems.org/docs + # # We run where the script is located. # @@ -33,8 +38,23 @@ fi cd latest ../rtems-docs-build-branches if [ -f rtems-docs-latest.tar.xz ]; then - mv rtems-docs-latest.tar.xz rtems-docs-latest-tags \ - /data/ftp/pub/rtems/people/chrisj/docs.rtems.org/latest/ + if [ ! -d ${handover} ]; then + ${mkdir} -p ${handover} + fi + # + # Empty the directory. + # + rm -rf ${handover}/* + # + # Copy to a holding directory on the destination file system and then move + # the files. The move will be quick while the move to the file system will be + # a slower copy and may result in the otherside looking at a partially copied + # file. + # + ${mkdir} -p ${handover}/hold + mv rtems-docs-latest.tar.xz rtems-docs-latest-tags ${handover}/hold/ + mv ${handover}/hold/* ${handover}/ + rm -rf ${handover}/hold fi cd .. -- cgit v1.2.3