Fix function "dependencies_check"
This commit is contained in:
parent
7c77e1a7a6
commit
3071fe251d
|
@ -5,19 +5,15 @@
|
||||||
# a : and the name of a package if the package on a Debian-ish system is not
|
# 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).
|
# named for the tool (i.e., qemu-user-static).
|
||||||
dependencies_check() {
|
dependencies_check() {
|
||||||
local depfile deps missing
|
local missing
|
||||||
|
|
||||||
for depfile in "$@"; do
|
if [[ -f "$1" ]]; then
|
||||||
if [[ -e "$depfile" ]]; then
|
for dep in $(cat "$1"); do
|
||||||
deps="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < ${BASE_DIR}/depends)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
for dep in $deps; do
|
|
||||||
if ! hash ${dep%:*} 2>/dev/null; then
|
if ! hash ${dep%:*} 2>/dev/null; then
|
||||||
missing="${missing:+$missing }${dep#*:}"
|
missing="${missing:+$missing }${dep#*:}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
fi
|
||||||
|
|
||||||
if [[ "$missing" ]]; then
|
if [[ "$missing" ]]; then
|
||||||
echo "Reqired dependencies not installed"
|
echo "Reqired dependencies not installed"
|
||||||
|
|
Reference in New Issue