From 5c63c5d985a7acdac36e94e1eb934c09b6f28102 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 4 Jul 2023 12:00:44 +0200 Subject: [PATCH] Add some debug output. Use repository path for opkg_commnds-file --- .githooks/post-checkout | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 12e4a9a..7fa51b5 100755 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -10,6 +10,19 @@ readonly OPKG_COMMANDS_FILE="./etc/psa_update/opkg_commands" if [ -f "$OPKG_COMMANDS_FILE" ]; then echo "POST-CHECKOUT $OPKG_COMMNDS_FILE EXISTS" > "/tmp/post_checkout.txt" + if grep -qE . "${OPKG_COMMANDS_FILE}"; then + echo "POST-CHECKOUT grep" > "/tmp/post_checkout.txt" + fi + readarray opkg_commands < <(cat "$OPKG_COMMANDS_FILE") + for opkg_c in "${opkg_commands[@]}"; do + # check for lines longer than 'opkg ' + if [ "${#opkg_c}" -gt 4 ]; then + # comment: spaces, at least one '#' + grep -qE '^[[:space:]]*#+.*$' <<< "$opkg_c" && continue + echo -n "EXECUTE, $opkg_c, $now, N/A" | tr -d '\n\r' >> "/tmp/post_checkout.txt" 2>&1 + echo "" >> $GIT_UPDATE_LOG 2>&1 + fi + done fi write_log_file () {