3 # This shell script is used to update the list of .po files and the
4 # dependencies for phpwiki.pot in the Makefile.
6 # Do not invoke this script directly, rather run:
10 # to update the Makefile.
13 # Generate the head (manually-edited part) of the new Makefile
16 sed '/^# DO NOT DELETE THIS LINE$/,$ d' Makefile && cat <<'EOF'
17 # DO NOT DELETE THIS LINE
19 # The remainder of this file is auto-generated
21 # (Run 'make depend' regenerate this section.)
26 # Find all .po files in po/.
29 find po -name "*.po" |
32 s|^.*/\(.*\)\.po$|mo: \1/LC_MESSAGES/phpwiki.mo \1/LC_MESSAGES/phpwiki.php|;'
35 # Find all php and html source code which should be scanned
36 # by xgettext() for localizeable strings.
37 # find ../lib fails on cygwin
38 # TODO: autogenerate .exclude list from CVS/Entries
40 test -f .exclude || ( echo lib/pear/ > .exclude; echo lib/WikiDB/adodb/ > .exclude; echo lib/nusoap/ > .exclude )
41 (cd ..; find lib themes \( -type d -regex '\(^lib/pear\)\|\(^lib/WikiDB/adodb\)\|\(^lib/nusoap\)\|\(^lib/fpdf\)' \) -prune -o \( -type f -a -name \*.php -o -name \*.tmpl \)) |
42 egrep -v '(^lib/pear)|(^lib/WikiDB/adodb)|(^lib/nusoap)|(^lib/fpdf)' |
44 sed 's|^|${POT_FILE}: ../|;' |
48 # Generate the new Makefile
52 pot_file_deps; } > Makefile.new || exit 1
54 if diff -q Makefile Makefile.new > /dev/null
56 # Don't touch the Makefile if unchanged.
57 # (This avoids updating the timestamp)
59 echo "Makefile unchanged" 1>&2
63 mv Makefile.new Makefile && echo "Makefile updated" 1>&2