Add some debug output. Use repository path for opkg_commnds-file

This commit is contained in:
Gerhard Hoffmann 2023-07-04 12:00:44 +02:00
parent 46a8a8f0e3
commit 5c63c5d985

View File

@ -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 () {