-
Notifications
You must be signed in to change notification settings - Fork 168
/
publish_doc
executable file
·78 lines (67 loc) · 2.24 KB
/
publish_doc
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
exit_usage() {
echo "$0 <ompi-www-dir>"
echo " copy built documentation from current hwloc directory"
echo " to destination clone of the ompi-www repository."
exit 1
}
dst="$1"
if test "x$dst" = "x" -o "x$dst" = "x-h" -o "x$dst" = "x--help"; then
exit_usage
fi
EXAMPLE=v2.8.0
if test -d "$dst/projects/hwloc/doc/$EXAMPLE/"; then
dst=`realpath "$dst/projects/hwloc/doc/"`
else if test -d "$dst/hwloc/doc/$EXAMPLE/"; then
dst=`realpath "$dst/hwloc/doc/"`
else if test -d "$dst/doc/$EXAMPLE/"; then
dst=`realpath "$dst/doc/"`
else if test -d "$dst/$EXAMPLE/"; then
:
else
echo "ERROR: Cannot find doc subdirectory in destination path."
exit 1
fi fi fi fi
echo "Will copy documentation to $dst"
while test `pwd` != /; do
test -f VERSION && break
cd ..
done
if ! test -f VERSION; then
echo "ERROR: Cannot find hwloc VERSION file in current directory or its parents."
exit 1
fi
VERSION=$(sh config/hwloc_get_version.sh ./VERSION)
if test x$VERSION = x; then
echo "ERROR: Failed to extract VERSION number from VERSION file."
exit 1
fi
echo "Found version $VERSION"
if ! test -e doc/doxygen-doc/hwloc-a4.pdf; then
echo "ERROR: doc/doxygen-doc/hwloc-a4.pdf not found."
exit 1
else if ! test -e doc/doxygen-doc/hwloc-letter.pdf; then
echo "ERROR: doc/doxygen-doc/hwloc-letter.pdf not found."
exit 1
else if ! test -d doc/www.open-mpi.org/html/; then
echo "ERROR: doc/www.open-mpi.org/html/ not found."
exit 1
fi fi fi
echo "Installing hwloc-v${VERSION}-a4.pdf ..."
cp -f doc/doxygen-doc/hwloc-a4.pdf "$dst/hwloc-v${VERSION}-a4.pdf"
echo "Installing hwloc-v${VERSION}-letter.pdf ..."
cp -f doc/doxygen-doc/hwloc-letter.pdf "$dst/hwloc-v${VERSION}-letter.pdf"
echo "Installing v${VERSION}/ HTML directory ..."
rsync -avz doc/www.open-mpi.org*inc doc/www.open-mpi.org/html/ "$dst/v${VERSION}/"
echo
echo "Replacing jquery.js with the common one ..."
rm -f "$dst/v${VERSION}/jquery.js"
ln -sf ../../../../includes/jquery.js "$dst/v${VERSION}/jquery.js"
echo
cd "$dst/v${VERSION}/"
echo "Looking for main page links:"
echo "- Examples:"
grep -l '<div class="section" id="cli_examples">' *.php || echo "Not found!"
echo "- 2.x API upgrade page:"
grep -l '<div class="title">Upgrading to the hwloc 2.0 API' *.php || echo "Not found!"
cd ../..