view lisp/w3/custom-check @ 142:1856695b1fa9 r20-2b5

Import from CVS: tag r20-2b5
author cvs
date Mon, 13 Aug 2007 09:33:18 +0200
parents 7d55a9ba150c
children
line wrap: on
line source

#!/bin/sh
EMACS=${1:-emacs}

if [ -n "$WIDGETDIR" ]; then
    exit 0
fi

if [ -z "$HOME" ]; then
    HOME=`(cd ; pwd)`
fi

if [ -f "${HOME}/.emacs" ]; then
    DOTEMACS="-l ${HOME}/.emacs"
fi

WITH=`   ${EMACS} -batch ${DOTEMACS}      -eval '(princ (file-truename (locate-library "custom")))' 2> /dev/null`
WITHOUT=`${EMACS} -batch -q -no-site-file -eval '(princ (file-truename (locate-library "custom")))' 2>/dev/null`

# For some reason XEmacs sometimes ends up with a newline at the beginning
# of the output... this will hopefully strip it out.
WITH=`echo $WITH | tr '\010\013' ' '`
WITHOUT=`echo $WITHOUT | tr '\013\010' ' '`

if [ "${WITH}" = "${WITHOUT}" ]; then
    exit 0
else
    DIRECTORY=`dirname ${WITH}`

    echo "WARNING -- WARNING -- WARNING"
    echo "Found custom in different places with and without ${HOME}/.emacs"
    echo
    echo "This could cause potential problems.  Please recompile with"
    echo "the environment variable WIDGETDIR set correctly.  Try this"
    echo "command:"
    echo "make WIDGETDIR=${DIRECTORY}"
    exit 1
fi