1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
raspberrypi-build/functions/dependencies_check.sh

26 lines
664 B
Bash

# dependencies_check
# $@ Dependnecy files to check
#
# Each dependency is in the form of a tool to test for, optionally followed by
# a : and the name of a package if the package on a Debian-ish system is not
# named for the tool (i.e., qemu-user-static).
dependencies_check() {
local missing
if [[ -f "$1" ]]; then
for dep in $(cat "$1"); do
if ! hash ${dep%:*} 2>/dev/null; then
missing="${missing:+$missing }${dep#*:}"
fi
done
fi
if [[ "$missing" ]]; then
echo "Reqired dependencies not installed"
echo
echo "This can be resolved on Debian/Raspbian systems by installing:"
echo "$missing"
false
fi
}