diff options
author | Nick Schermer <nick@xfce.org> | 2010-10-31 12:09:20 +0100 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2010-10-31 12:29:25 +0100 |
commit | 7d85dae9cbd88e40fe987dc97e9453932e09b2ca (patch) | |
tree | b34ab1a4d3a55b64e12cb443c329df9bf19a3767 /scripts | |
parent | ddc1f35ba246fea94eea293a8f530de95aa0253e (diff) | |
download | xfce4-dev-tools-7d85dae9cbd88e40fe987dc97e9453932e09b2ca.tar.gz |
Add check stage for documentation submodules.
This adds an extra check when XDT_AUTOGEN_CHECK_DOCS
is defined. This variable points to the directory that
should contain the xfce4-docs submodule.
If no submodule clone if found and autogen.sh is running
from within a git clone, it will automatically initialize
the submodule for the user, if not it will show an error
and abort xdt-autogen, since configure will abort too if
we continue because of missing makefile.am files.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/xdt-autogen.in.in | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/scripts/xdt-autogen.in.in b/scripts/xdt-autogen.in.in index 2d14ef8..c7892b6 100644 --- a/scripts/xdt-autogen.in.in +++ b/scripts/xdt-autogen.in.in @@ -197,8 +197,11 @@ do_version_check() { } if ! do_version_check; then - echo "This version of xdt-autogen ($VERSION) is too old. Version" >&2 - echo "$XDT_AUTOGEN_REQUIRED_VERSION or greater is required." >&2 + cat >&2 <<EOF +xdt-autogen: This version of xdt-autogen ($VERSION) is too old. + Version $XDT_AUTOGEN_REQUIRED_VERSION or greater is required. +EOF + exit 1 fi @@ -215,6 +218,41 @@ export XDG_DATA_DIRS XDG_DATA_HOME MASTER_DIR=`pwd`; test -z "${MASTER_DIR}" && MASTER_DIR="." ## +## Check for documentation submodule +## +if test -n "$XDT_AUTOGEN_CHECK_DOCS"; then + if test ! -f "$MASTER_DIR/$XDT_AUTOGEN_CHECK_DOCS/Makefile.am"; then + # Check for git and needed files, if found, automatically + # update the submodule + if test -d .git -a -f .gitmodules; then + echo "xdt-autogen: Automaticcaly initializing the $XDT_AUTOGEN_CHECK_DOCS submodule." + + # Run git command to get the lastest docs revision + res=0 && git submodule sync $XDT_AUTOGEN_CHECK_DOCS && \ + git submodule update --init $XDT_AUTOGEN_CHECK_DOCS && res=1 + + if test $res -eq 0; then + cat >&2 <<EOF +xdt-autogen: Pulling the xfce4-docs git submodule failed. See errors + above for more information and take a look at + http://wiki.xfce.org/documentation. +EOF + exit 1 + fi + else + cat >&2 <<EOF +xdt-autogen: The directory $XDT_AUTOGEN_CHECK_DOCS does not contain + the required files to run configure. See + http://wiki.xfce.org/documentation for more information. +EOF + exit 1 + fi + #else + # We could warn about out-of-date submodules here. + fi +fi + +## ## First we do some substitutions to generate configure.{ac,in} if necessary ## CONFIGURE_AC_IN_FILES=`lookup_configure_ac_in_files "$MASTER_DIR"` |