blob: 1be7778a928a601d7da1a67d8e22c167bc8ff8ee (
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/docs
#
# 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-docs-build-branches
if [ -f rtems-docs-latest.tar.xz ] && [ -f rtems-docs-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-docs-latest.tar.xz rtems-docs-latest-tags ${handover}/hold/
mv ${handover}/hold/* ${handover}/
rm -rf ${handover}/hold
fi
cd ..
exit 0
|