aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-09-25 11:52:14 +0000
committermerakor <cem@ckyln.com>2020-09-25 11:52:14 +0000
commit8e8aa9345d8df42eae2a468929336fdad38c39dd (patch)
treee24ad111af69f44167d197f5fe166045c4b24706
parent14c751413885c93bda0b1369604e87218a33cbf4 (diff)
downloadcpt-8e8aa9345d8df42eae2a468929336fdad38c39dd.tar.gz
pkg_build(): Notify the user if the build file was modified.
Since the build file can be modified during the pre-build hook, a user can easily forget about their modifications to the build file, especially if they have completely rewritten their build script in the hook. FossilOrigin-Name: 9051885b256f0730b4cdbd2703fc3b3c0e41ed12173424f4a9f748f0ee2ad3bf
-rw-r--r--src/cpt-lib5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cpt-lib b/src/cpt-lib
index cdc7d93..ebd55a0 100644
--- a/src/cpt-lib
+++ b/src/cpt-lib
@@ -954,6 +954,11 @@ pkg_build() {
run_hook pre-build "$pkg" "$pkg_dir/$pkg"
+ # Notify the user if the build script is changed during the pre-build
+ # hook.
+ diff -q "$repo_dir/build" .build.cpt ||
+ log "$pkg" "Executing the modified build file"
+
# 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.