From 8473b925fd94fdb7bb1ae6309a4ab58d490382c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 19 Jul 2012 19:37:26 +0200 Subject: Fixing up inclusion of functions while allowing local usage of live-build with different file layouts. --- scripts/build/lb_chroot_hooks | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'scripts/build/lb_chroot_hooks') diff --git a/scripts/build/lb_chroot_hooks b/scripts/build/lb_chroot_hooks index b07474d7a..1b754e04d 100755 --- a/scripts/build/lb_chroot_hooks +++ b/scripts/build/lb_chroot_hooks @@ -11,7 +11,7 @@ set -e # Including common functions -. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh +( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh # Setting static variables DESCRIPTION="$(Echo 'execute hooks in chroot')" @@ -52,11 +52,15 @@ mount -o remount,ro,bind config chroot/root/config # Copying hooks for _HOOK in ${LB_CHROOT_HOOKS} do - if [ -e "${LB_BASE}"/hooks/???-"${_HOOK}".chroot ] - then - mkdir -p chroot/root/lb_chroot_hooks - cp "${LB_BASE}"/hooks/???-"${_HOOK}".chroot chroot/root/lb_chroot_hooks - fi + for LOCATION in "${LIVE_BUILD}/hooks" /usr/share/live/build/hooks + do + if [ -e "${LOCATION}/hooks/???-${_HOOK}.binary" ] + then + mkdir -p chroot/root/lb_chroot_hooks + cp "${LOCATION}"/hooks/???-"${_HOOK}".chroot chroot/root/lb_chroot_hooks + continue + fi + done done # Running hooks -- cgit v1.2.3