3 # GDB script to create web ARI page directly from within gdb/ari directory.
5 # Copyright (C) 2012-2019 Free Software Foundation, Inc.
7 # This file is part of GDB.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 # Determine directory of current script.
23 scriptpath
=`dirname $0`
24 # If "scriptpath" is a relative path, then convert it to absolute.
25 if [ "`echo ${scriptpath} | cut -b1`" != '/' ] ; then
26 scriptpath
="`pwd`/${scriptpath}"
29 # update-web-ari.sh script wants four parameters
30 # 1: directory of checkout src or gdb-RELEASE for release sources.
31 # 2: a temp directory.
32 # 3: a directory for generated web page.
33 # 4: The name of the current package, must be gdb here.
34 # Here we provide default values for these 4 parameters
37 if [ -z "${srcdir}" ] ; then
38 srcdir
=${scriptpath}/..
/..
/..
41 # Determine location of a temporary directory to be used by
42 # update-web-ari.sh script.
43 if [ -z "${tempdir}" ] ; then
44 if [ ! -z "$TMP" ] ; then
45 tempdir
=$TMP/create-ari
46 elif [ ! -z "$TEMP" ] ; then
47 tempdir
=$TEMP/create-ari
49 tempdir
=/tmp
/create-ari
53 # Default location of generate index.hmtl web page.
54 if [ -z "${webdir}" ] ; then
55 # Use 'branch' subdir name if Tag contains branch
56 if [ -f "${srcdir}/gdb/CVS/Tag" ] ; then
57 tagname
=`cat "${srcdir}/gdb/CVS/Tag"`
58 elif [ -d "${srcdir}/.git" ] ; then
59 tagname
=`cd ${srcdir} && git rev-parse --abbrev-ref HEAD`
60 if test "$tagname" = "master"; then
66 if [ "${tagname#branch}" != "${tagname}" ] ; then
71 webdir
=`pwd`/${subdir}/ari
74 # Launch update-web-ari.sh in same directory as current script.
75 ${SHELL} ${scriptpath}/update-web-ari.sh ${srcdir} ${tempdir} ${webdir} gdb
77 if [ -f "${webdir}/index.html" ] ; then
78 echo "ARI output can be viewed in file \"${webdir}/index.html\""
80 echo "ARI script failed to generate file \"${webdir}/index.html\""