6 if [ "x$1" = "x--help" ]; then
8 echo Usage: ./update.sh langcode
9 echo --help display this help and exit
10 echo --missing search for missing files in POTFILES.in
11 echo --version shows the version
14 echo ./update.sh ----- just creates a new pot file from the source
15 echo ./update.sh da -- created new pot file and updated the da.po file
17 elif [ "x$1" = "x--version" ]; then
19 echo "update.sh release $VERSION"
21 elif [ "x$1" = "x--missing" ]; then
23 echo "Searching for files containing _( ) but missing in POTFILES.in..."
25 find ../ -print | egrep '.*\.(c|y|cc|c++|h|gob)' | xargs grep _\( | cut -d: -f1 | uniq | cut -d/ -f2- > POTFILES.in.missing
28 echo "Sorting data..."
29 sort -d POTFILES.in -o POTFILES.in &&
30 sort -d POTFILES.in.missing -o POTFILES.in.missing
32 echo "Comparing data..."
33 diff POTFILES.in POTFILES.in.missing -u0 | grep '^+' |grep -v '^+++'|grep -v '^@@' > POTFILES.in.missing
36 if [ -s POTFILES.ignore ]; then
38 sort -d POTFILES.ignore -o POTFILES.tmp
39 echo "Evaluating ignored files..."
41 diff POTFILES.tmp POTFILES.in.missing -u0 | grep '^+' |grep -v '^+++'|grep -v '^@@' > POTFILES.in.missing
46 if [ -s POTFILES.in.missing ]; then
48 echo && echo "Here are the results:"
49 echo && cat POTFILES.in.missing
50 echo && echo "File POTFILES.in.missing is being placed in directory..."
51 echo "Please add the files that should be ignored in POTFILES.ignore"
55 echo &&echo "There are no missing files, thanks God!"
56 rm POTFILES.in.missing
60 elif [ "x$1" = "x" ]; then
62 echo "Building the $PACKAGE.pot ..."
64 xgettext --default-domain=$PACKAGE --directory=.. \
65 --add-comments --keyword=_ --keyword=N_ \
66 --files-from=./POTFILES.in \
67 && test ! -f $PACKAGE.po \
68 || ( rm -f ./$PACKAGE.pot \
69 && mv $PACKAGE.po ./$PACKAGE.pot );
75 xgettext --default-domain=$PACKAGE --directory=.. \
76 --add-comments --keyword=_ --keyword=N_ \
77 --files-from=./POTFILES.in \
78 && test ! -f $PACKAGE.po \
79 || ( rm -f ./PACKAGE.pot \
80 && mv $PACKAGE.po ./$PACKAGE.pot );
82 echo "Building the $PACKAGE.pot ..."
83 echo "Now merging $1.po with $PACKAGE.pot, and creating an updated $1.po ..."
85 mv $1.po $1.po.old && msgmerge $1.po.old $PACKAGE.pot -o $1.po \
88 msgfmt --statistics $1.po
92 echo Sorry $1.po does not exist!