Prevent users to tick "Rebuild Makefile" if Makefile does not exist

For some reason, beginners tend to tick this at the first pass. Since
it is hard to prevent that in Config.in, use a sanity check in jhalfs.
This commit is contained in:
Pierre Labastie 2020-07-10 13:26:23 +00:00
parent e3ccc2786a
commit 8b85dae454

10
jhalfs
View file

@ -475,10 +475,16 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
fi fi
# When regenerating the Makefile, we need to know also the
# canonical book version
# shellcheck disable=SC2034 # shellcheck disable=SC2034
if [[ "$REBUILD_MAKEFILE" = "y" ]] ; then if [[ "$REBUILD_MAKEFILE" = "y" ]] ; then
# Sanity check: users tend to tick "rebuild Makefile"
# without generating one first. Check we have one:
if [ ! -f $MKFILE ]; then
set -e
error_message "You cannot \"rebuild Makefile\" without first building one"
fi
# When regenerating the Makefile, we need to know also the
# canonical book version
case $PROGNAME in case $PROGNAME in
clfs* ) clfs* )
VERSION=$(xmllint --noent "$BOOK/prologue/$ARCH/bookinfo.xml" 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;; VERSION=$(xmllint --noent "$BOOK/prologue/$ARCH/bookinfo.xml" 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;