Description: Fix hook execution Author: Colin Watson Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685534 Last-Update: 2012-08-21 Index: b/scripts/build/lb_chroot_hooks =================================================================== --- a/scripts/build/lb_chroot_hooks +++ b/scripts/build/lb_chroot_hooks @@ -54,12 +54,14 @@ do 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 + for FILE in "${LOCATION}"/???-"${_HOOK}".chroot + do + if [ -e "${FILE}" ] + then + mkdir -p chroot/root/lb_chroot_hooks + cp "${FILE}" chroot/root/lb_chroot_hooks + fi + done done done Index: b/scripts/build/lb_binary_hooks =================================================================== --- a/scripts/build/lb_binary_hooks +++ b/scripts/build/lb_binary_hooks @@ -43,17 +43,18 @@ # Running hooks for _HOOK in ${LB_BINARY_HOOKS} do - for LOCATION in "${LIVE_BUILD}/hooks" /usr/share/live/build/hooks + for LOCATION in "${LIVE_BUILD}/hooks" /usr/share/live/build/hooks + do + for FILE in "${LOCATION}"/???-"${_HOOK}".binary do - if [ -e "${LOCATION}/hooks/???-${_HOOK}.binary" ] + if [ -e "${FILE}" ] then cd binary - ./"${LOCATION}/hooks/???-${_HOOK}.binary" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;} + ./"${FILE}" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;} cd "${OLDPWD}" - - continue fi done + done done ## Processing local hooks