diff options
author | Frans Pop <elendil@planet.nl> | 2008-12-02 16:31:38 +0000 |
---|---|---|
committer | Frans Pop <elendil@planet.nl> | 2008-12-02 16:31:38 +0000 |
commit | 4055c8fecddf70914a17eb20a86568921edd8637 (patch) | |
tree | c21c9087d4c19e42dbbc9298c476a81c6052a590 /scripts | |
parent | 6c538fe6a652278f6d2d1ea57b3d6cbea7e5fff6 (diff) | |
download | installation-guide-4055c8fecddf70914a17eb20a86568921edd8637.zip |
And now we're getting close to being ridiculously complex: also check settings with line continuations
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check-preseed | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/scripts/check-preseed b/scripts/check-preseed index 7c527bf83..e3d646bed 100755 --- a/scripts/check-preseed +++ b/scripts/check-preseed @@ -2,6 +2,27 @@ lang="$1" +filter_preseed() { + awk '/^#~/ { + next + } + /^\"?#?d-i/ { + print + next + } + /\\+[[:space:]]*(\\n\")?$/ { + print + in_seq=1 + next + } + /.*/ { + if (in_seq) { + print + in_seq=0 + } + }' +} + if [ -z "$lang" ] || ([ ! -d po/"$lang" ] && [ ! -d "./$lang" ]); then echo "Usage: $(basename $0) <language>" exit 1 @@ -19,15 +40,15 @@ tmp_orig=$(mktemp -p /tmp preseed_orig.XXXXXX) tmp_trans=$(mktemp -p /tmp preseed_trans.XXXXXX) if [ -d "po/$lang" ]; then - cd $po + cd po/$lang sed -n "/^msgid/,/^msgstr/ p" preseed.po | grep -v msgstr | \ - grep "^\"#\?d-i " >$tmp_orig + filter_preseed >$tmp_orig sed -n "/^msgstr/,/^$/ p" preseed.po | \ - grep "^\"#\?d-i " >$tmp_trans + filter_preseed >$tmp_trans else - grep "^#\?d-i " en/appendix/preseed.xml >$tmp_orig - grep "^#\?d-i " $lang/appendix/preseed.xml >$tmp_trans + filter_preseed <en/appendix/preseed.xml >$tmp_orig + filter_preseed <$lang/appendix/preseed.xml >$tmp_trans fi echo "Number of original lines: $(wc -l <$tmp_orig)" |