1
0
mirror of https://git.fsfe.org/FSFE/fsfe-local-build.git synced 2026-04-18 10:23:05 +02:00

adding dependency check; improve help display

This commit is contained in:
2017-01-19 19:19:53 +01:00
parent fd7ba1e8fe
commit 3866e8752a

View File

@@ -25,6 +25,24 @@
#
#######################################################################
# Check dependencies (stolen from build_main.sh)
deperrors=''
for depend in realpath rsync xsltproc xmllint sed find egrep grep wc make tee date iconv; do
if ! which "$depend" >/dev/null 2>&1; then
deperrors="$depend $deperrors"
fi
done
if [ -n "$deperrors" ]; then
printf '\033[1;31m'
cat <<-EOF
The build script depends on some other programs to function.
Not all of those programs could be located on your system.
Please use your package manager to install the following programs:
EOF
printf '\n\033[0;31m%s\n' "$deperrors"
exit 1
fi >>/dev/stderr
ROOT=$(dirname "$(readlink -f "$0")")
if [ ! -e "$ROOT"/config.cfg ]; then echo "Missing config.cfg file. Edit and rename config.cfg.sample"; exit 1; fi
source "$ROOT"/config.cfg
@@ -37,12 +55,15 @@ if [ "$1" = "" ]; then
echo "Usage: "
echo
echo "$self file.en.xhtml"
echo " -- build single XHTML file from your source to the local web directory"
echo " the destination will be on the same relative level of the selected XHTML file"
echo " -- build single XHTML file from your source to the local web "
echo " directory"
echo " The destination will be on the same relative level of the "
echo " selected XHTML file"
echo " If not a XHTML file, it will be copied to the web directory"
echo
echo "$self --copy picture.png look/style.css"
echo " -- Just copies several files to the local web directory without even trying to build them"
echo " -- Just copies several files to the local web directory without "
echo " even trying to build them"
exit 0
fi