Add POT source path validation to per-project processing
These are some of the changes that this MR makes
validate_paths.bash (new file)
Takes Aviral's validation script and modifies it
Key changes:
- Output now matches Scripty's existing log format seen here: https://logs.l10n.kde.org/260323.branches_stable_l10n-kf6
- One
WARNING in <file>: <message>line per bad path - One self-contained summary line per POT always printed
- No output beyond the summary when everything is correct
extract-messages.sh (modified)
Added the following after the repack step, before cleanup:
# Validate that #: source paths in each generated POT are relative to the
# project root. One WARNING line per bad path; one summary line per POT.
# Output goes to stdout so it appears in the Scripty log like other warnings.
find -L $podir -iname '*.pot' | while read -r pot; do
bash "$l10nscripts/validate_paths.bash" "$pot" "$project_root_dir"
done
Testing
Tested in a Linux Docker container against konsole.
Clean run:
echo '#: src/colorscheme/RandomizationRange.cpp:1' > /tmp/test_clean.pot
bash validate_paths.bash /tmp/test_clean.pot ~/kde/src/konsole
# POT source path check passed: /tmp/test_clean.pot (1 path(s) verified)
# Exit: 0
Real project with known bad paths:
bash validate_paths.bash konsole/po/de/konsole.po ~/kde/src/konsole
# 77 WARNING lines for non-root-relative paths
# Exit: 1
Injected missing path:
echo "#: fake/doesnotexist.cpp:1" >> konsole.po
bash validate_paths.bash konsole.po ~/kde/src/konsole
# WARNING in ...: source path not found in project: fake/doesnotexist.cpp
# Exit: 1