Browse Source

Dependency checks + important bugfix (#16)

pull/20/head
Joseph Carter 5 years ago
committed by XECDesign
parent
commit
0245cbb958
4 changed files with 40 additions and 2 deletions
  1. +1
    -1
      README.md
  2. +4
    -1
      build.sh
  3. +5
    -0
      depends
  4. +30
    -0
      scripts/dependencies_check

+ 1
- 1
README.md View File

@ -5,7 +5,7 @@
#Dependencies
`quilt kpartx realpath qemu-user-static debootstrap zerofree pxz`
`quilt kpartx realpath qemu-user-static debootstrap zerofree pxz zip`
#Config

+ 4
- 1
build.sh View File

@ -17,7 +17,6 @@ EOF
if [ -f ${i}-packages-nr ]; then
log "Begin ${SUB_STAGE_DIR}/${i}-packages-nr"
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < ${i}-packages-nr)"
PACKAGES="$(sed -e "$sed_expr_packages" < ${i}-packages-nr)"
if [ -n "$PACKAGES" ]; then
on_chroot sh -e - << EOF
apt-get install --no-install-recommends -y $PACKAGES
@ -158,6 +157,10 @@ export QUILT_NO_DIFF_TIMESTAMPS=1
export QUILT_REFRESH_ARGS="-p ab"
source ${SCRIPT_DIR}/common
source ${SCRIPT_DIR}/dependencies_check
dependencies_check ${BASE_DIR}/depends
mkdir -p ${WORK_DIR}
log "Begin ${BASE_DIR}"

+ 5
- 0
depends View File

@ -0,0 +1,5 @@
quilt
qemu-arm-static:qemu-user-static
debootstrap
kpartx zerofree
pxz zip

+ 30
- 0
scripts/dependencies_check View File

@ -0,0 +1,30 @@
# dependencies_check
# [email protected] 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 "[email protected]"; 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…
Cancel
Save