From 8e8aa9345d8df42eae2a468929336fdad38c39dd Mon Sep 17 00:00:00 2001 From: merakor Date: Fri, 25 Sep 2020 11:52:14 +0000 Subject: 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 --- src/cpt-lib | 5 +++++ 1 file changed, 5 insertions(+) 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. -- cgit v1.2.3