summaryrefslogtreecommitdiff
path: root/doxygen/builder/rtems-doxygen-upload
blob: a80b1c5587a6bf3aec12e3f56bb5b8f030e9141e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/sh
#
# RTEMS Documentation Project
#
# Copyright 2017 Chris Johns <chrisj@rtems.org>
# All rights reserved
#
# Public domain
#

#
# Exit on error.
#
set -e

#
# Executables
#
mkdir=/bin/mkdir

#
# Handover path.
#
handover=/data/ftp/pub/rtems/people/chrisj/docs.rtems.org/doxygen

#
# We run where the script is located.
#
cd $(dirname $0)

#
# If no update directory create it.
#
if [ ! -d latest ]; then
 ${mkdir} latest
fi

cd latest
 ../rtems-doxygen-build-branches
 if [ -f rtems-doxygen-latest.tar.gz ] && [ -f rtems-doxygen-latest-tags ]; then
  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-doxygen-latest.tar.gz rtems-doxygen-latest-tags ${handover}/hold/
  mv ${handover}/hold/* ${handover}/
  rm -rf ${handover}/hold
 fi
 cd ..

exit 0