parent
7969dfd5a1
commit
d4ad78dd70
6
build.sh
6
build.sh
|
@ -156,11 +156,11 @@ export QUILT_NO_DIFF_INDEX=1
|
|||
export QUILT_NO_DIFF_TIMESTAMPS=1
|
||||
export QUILT_REFRESH_ARGS="-p ab"
|
||||
|
||||
source ${SCRIPT_DIR}/common.sh
|
||||
source ${SCRIPT_DIR}/check_deps.sh
|
||||
source ${SCRIPT_DIR}/common
|
||||
source ${SCRIPT_DIR}/dependencies_check
|
||||
|
||||
|
||||
check_deps ${BASE_DIR}/depends
|
||||
dependencies_check ${BASE_DIR}/depends
|
||||
|
||||
mkdir -p ${WORK_DIR}
|
||||
log "Begin ${BASE_DIR}"
|
||||
|
|
33
scripts/check_deps.sh
Normal file → Executable file
33
scripts/check_deps.sh
Normal file → Executable file
|
@ -1,33 +0,0 @@
|
|||
# bash #
|
||||
|
||||
# check_deps
|
||||
# $@ 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).
|
||||
check_deps()
|
||||
{
|
||||
local depfile deps missing
|
||||
|
||||
for depfile in "$@"; do
|
||||
if [[ -e "$depfile" ]]; then
|
||||
deps="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < ${BASE_DIR}/depends)"
|
||||
|
||||
fi
|
||||
for dep in $deps; do
|
||||
if ! hash ${dep%:*} 2>/dev/null; then
|
||||
missing="${missing:+$missing }${dep#*:}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if [[ "$missing" ]]; then
|
||||
echo "Reqired dependencies not installed"
|
||||
echo
|
||||
echo "This can be resolved on Debian/Raspbian systems by installing:"
|
||||
echo "$missing"
|
||||
false
|
||||
fi
|
||||
}
|
||||
export -f check_deps
|
|
@ -1,5 +1,3 @@
|
|||
# bash #
|
||||
|
||||
log (){
|
||||
date +"[%T] $@" | tee -a ${LOG_FILE}
|
||||
}
|
30
scripts/dependencies_check
Normal file
30
scripts/dependencies_check
Normal file
|
@ -0,0 +1,30 @@
|
|||
# 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 depfile deps missing
|
||||
|
||||
for depfile in "$@"; do
|
||||
if [[ -e "$depfile" ]]; then
|
||||
deps="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < ${BASE_DIR}/depends)"
|
||||
|
||||
fi
|
||||
for dep in $deps; do
|
||||
if ! hash ${dep%:*} 2>/dev/null; then
|
||||
missing="${missing:+$missing }${dep#*:}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if [[ "$missing" ]]; then
|
||||
echo "Reqired dependencies not installed"
|
||||
echo
|
||||
echo "This can be resolved on Debian/Raspbian systems by installing:"
|
||||
echo "$missing"
|
||||
false
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue
Block a user