diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-03-13 11:01:13 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-03-13 11:01:13 +0000 |
commit | c60edfe62c14e0fb235ca93297118d8501ee44ed (patch) | |
tree | d5a0da22ce4fce7d429812af5f9b8398f1a4806d /kiss | |
parent | 2f5a560831e3bde34a477431eff6a3eae9b84dce (diff) | |
download | cpt-c60edfe62c14e0fb235ca93297118d8501ee44ed.tar.gz |
kiss: Allow hooks to modify build files
FossilOrigin-Name: 4894b8f8df5d5c6be3b3126506be0cf368711aaecc34d1105c42b97270769c6f
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -583,14 +583,19 @@ pkg_build() { # Move to the build directory. cd "$mak_dir/$pkg" - log "$pkg" "Starting build" + # Copy the build file to the current cache directory so that + # it can be modified by package manager hooks. This allows + # for simple build changes to be made without the need to + # fork the entire package. + cp -f "$repo_dir/build" .build + log "$pkg" "Starting build" run_hook pre-build "$pkg" "$pkg_dir/$pkg" # Call the build script, log the output to the terminal # and to a file. There's no PIPEFAIL in POSIX shelll so # we must resort to tricks like killing the script ourselves. - { "$repo_dir/build" "$pkg_dir/$pkg" 2>&1 || { + { "./.build" "$pkg_dir/$pkg" 2>&1 || { log "$pkg" "Build failed" log "$pkg" "Log stored to $log_dir/$pkg-$time-$pid" run_hook build-fail "$pkg" "$pkg_dir/$pkg" |