Skip to content
Snippets Groups Projects
Unverified Commit 8d2bd817 authored by Oliver Smith's avatar Oliver Smith
Browse files

Makefile: install: add sanity checks

Prevent the user from installing to the wrong firefox dir, and give a
userfriendly message if install needs root rights.
parent dd2150f9
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@ out/userContent.files: $(USERCONTENT_FILES) out
done > $@
install: all
src/prepare_install.sh "$(FIREFOX_DIR)" "$(DESTDIR)"
install -Dm644 src/policies.json \
"$(DESTDIR)/$(FIREFOX_CONFIG_DIR)/policies/policies.json"
install -Dm644 src/mobile-config-prefs.js \
......
#!/bin/sh
FIREFOX_DIR="$1"
DESTDIR="$2"
if ! [ -d "$FIREFOX_DIR"/browser ]; then
if [ -d "$FIREFOX_DIR"-esr/browser ]; then
echo
echo "ERROR: Firefox ESR is installed, but FIREFOX_DIR points to"
echo " regular Firefox."
echo
echo "Run this instead:"
echo "$ make"
echo "$ sudo make FIREFOX_DIR=$FIREFOX_DIR-esr install"
echo
exit 1
else
echo
echo "WARNING: FIREFOX_DIR does not exist: $FIREFOX_DIR"
echo "This should be fine during packaging. However if you just ran"
echo "'make install' manually, consider running 'make uninstall', then"
echo "adjusting FIREFOX_DIR (in the Makefile or via environment"
echo "variable) and running 'make install' again."
echo
fi
fi
if [ -z "$DESTDIR" ] && [ "$(id -u)" != 0 ]; then
echo
echo "ERROR: run make install as root!"
echo
echo "$ make"
echo "$ sudo make FIREFOX_DIR=$FIREFOX_DIR install"
echo
exit 1
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment