]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
make.sh: Check for changes in logs
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 16 Oct 2024 16:40:50 +0000 (16:40 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 16 Oct 2024 16:40:50 +0000 (16:40 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index f68a61c1c197855309fd8b5276f05db92092e57c..35a602f6252716742d74a0959c6be87284470d21 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -2275,6 +2275,26 @@ check_rootfiles() {
        return ${failed}
 }
 
+check_changed_rootfiles() {
+       local files=(
+               $(grep --files-with-matches -r "^+" "${LOG_DIR}" --exclude="_*" | sort)
+       )
+
+       # If we have no matches, there is nothing to do
+       [ "${#files[@]}" -eq 0 ] && return 0
+
+       print_line "Packages have created new files"
+       print_status WARN
+
+       local file
+       for file in ${files[@]}; do
+               print_line "  ${file##*/}"
+               print_status WARN
+       done
+
+       return 0
+}
+
 # Set BASEDIR
 readonly BASEDIR="$(find_base)"
 
@@ -2478,6 +2498,8 @@ build)
                exiterror "Rootfiles are inconsistent"
        fi
 
+       check_changed_rootfiles
+
        print_build_summary $(( SECONDS - START_TIME ))
        ;;
 tail)
@@ -2496,6 +2518,9 @@ shell)
        prepareenv --network
        entershell
        ;;
+check)
+       check_changed_rootfiles
+       ;;
 clean)
        print_line "Cleaning build directory..."