3 ## live-build(7) - System Build Scripts
4 ## Copyright (C) 2006-2014 Daniel Baumann <mail@daniel-baumann.ch>
6 ## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7 ## This is free software, and you are welcome to redistribute it
8 ## under certain conditions; see COPYING for details.
13 # Including common functions
14 [ -e "${LIVE_BUILD}/scripts/build.sh" ] && .
"${LIVE_BUILD}/scripts/build.sh" || .
/usr
/lib
/live
/build.sh
16 # Setting static variables
17 DESCRIPTION
="$(Echo 'execute hooks in source')"
19 USAGE
="${PROGRAM} [--force]"
23 # Reading configuration files
24 Read_conffiles config
/all config
/common config
/bootstrap config
/chroot config
/source config
/source
27 Echo_message
"Begin executing hooks..."
29 # Requiring stage file
30 Require_stagefile .build
/config .build
/bootstrap
33 Check_stagefile .build
/source_hooks
41 ## Processing distribution hooks
44 for _HOOK
in ${LB_BINARY_HOOKS}
46 for LOCATION
in "${LIVE_BUILD}/hooks" /usr
/share
/live
/build
/hooks
48 for FILE
in "${LOCATION}"/????
-"${_HOOK}".
source
53 "${FILE}" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
60 ## Processing local hooks
62 if Find_files config/hooks/*.source
64 for HOOK in config/hooks/*.source
66 # Making hook executable
73 ./"${HOOK}" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
77 Create_stagefile .build
/source_hooks