annotate help/help_diff.sh @ 15296:f2c1c1034d66

synced with 1.56
author gabrov
date Fri, 29 Apr 2005 19:36:42 +0000
parents c90a84da69f1
children 3fb0eb698ce8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8538
6973e76d95b2 In this situation it was easier to fix yours. I applied these 3 points
arpi
parents: 7484
diff changeset
1 #!/bin/sh
6285
0b73c83bc47f automatically adding untranslated messages to help_mp.h from english master file
arpi
parents:
diff changeset
2
10648
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
3 # This script walks through the master (stdin) help/message file, and
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
4 # prints (stdout) only those messages which are missing from the help
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
5 # file given as parameter ($1).
6285
0b73c83bc47f automatically adding untranslated messages to help_mp.h from english master file
arpi
parents:
diff changeset
6 #
10648
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
7 # Example: help_diff.sh help_mp-hu.h < help_mp-en.h > missing.h
6285
0b73c83bc47f automatically adding untranslated messages to help_mp.h from english master file
arpi
parents:
diff changeset
8
10648
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
9 curr=""
6285
0b73c83bc47f automatically adding untranslated messages to help_mp.h from english master file
arpi
parents:
diff changeset
10
10648
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
11 while read -r line; do
10636
7938ee85f355 shorter, sweeter, more portable, better calling syntax
diego
parents: 8732
diff changeset
12 if echo "$line" | grep '^#define' > /dev/null 2>&1; then
8732
450015fb59e6 FreeBSD fix
nexus
parents: 8538
diff changeset
13 curr=`echo "$line" | cut -d ' ' -f 2`
14865
c90a84da69f1 We should match end of token as well, to prevent MSGTR_FOO2 matching instead of
wight
parents: 10648
diff changeset
14 if grep "^#define $curr[ ]" $1 > /dev/null 2>&1; then
10648
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
15 curr=""
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
16 fi
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
17 else
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
18 if [ -z "$line" ]; then
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
19 curr=""
8538
6973e76d95b2 In this situation it was easier to fix yours. I applied these 3 points
arpi
parents: 7484
diff changeset
20 fi
6973e76d95b2 In this situation it was easier to fix yours. I applied these 3 points
arpi
parents: 7484
diff changeset
21 fi
10648
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
22
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
23 if [ -n "$curr" ]; then
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
24 echo "$line"
96170748b6a9 Reversed + changed grep -q to grep > /dev/null 2>&1. -q is a GNU extension
diego
parents: 10636
diff changeset
25 fi
6286
arpi
parents: 6285
diff changeset
26 done