diff options
author | John Dennis <jdennis@redhat.com> | 2010-02-20 11:00:01 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-02-22 16:38:56 -0500 |
commit | 2d3d093d4f26ea7a2292e092886106ef6d73629b (patch) | |
tree | 48ed8785586e00087ecf9714bb4f2c70119dba05 /install/po | |
parent | 23ac2c31e70424ced2acce8dfd6fca15df8a839b (diff) | |
download | freeipa-2d3d093d4f26ea7a2292e092886106ef6d73629b.tar.gz freeipa-2d3d093d4f26ea7a2292e092886106ef6d73629b.tar.xz freeipa-2d3d093d4f26ea7a2292e092886106ef6d73629b.zip |
make update-pot will not touch pot file if msgid's are unmodified
Formerly running 'make update-pot' would write an insignificantly
different pot file even if the msgid's xgettext found were unmodfied.
Now the result of running xgettext is compared to the existing
pot file after adjusting for things like timestamps, and only
copies the result of xgettext to the new pot file if there
were differences.
This will help eliminate git commits on the pot file if all one
did was see if the pot file was up to date, if it was up to date
git won't see any modifications. It used to be that timestamps
would be different in the pot file just by virtue of checking
if the pot file was current.
fix exit status; replace POT with $(DOMAN).pot
Diffstat (limited to 'install/po')
-rw-r--r-- | install/po/Makefile.in | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/install/po/Makefile.in b/install/po/Makefile.in index ac3ab649..401322fb 100644 --- a/install/po/Makefile.in +++ b/install/po/Makefile.in @@ -193,8 +193,8 @@ update-po: update-pot $(MAKE) all update-pot: - rm -f $(DOMAIN).pot.update - $(XGETTEXT) $(XGETTEXT_OPTIONS) \ + @rm -f $(DOMAIN).pot.update + @$(XGETTEXT) $(XGETTEXT_OPTIONS) \ --output $(DOMAIN).pot.update \ --language="python" \ $(PYTHON_POTFILES) \ @@ -203,13 +203,19 @@ update-pot: --output $(DOMAIN).pot.update \ --join-existing \ --language="c" \ - $(C_POTFILES) \ - && \ - mv $(DOMAIN).pot.update $(DOMAIN).pot \ - && \ - # Replace the charset with UTF-8 ; \ - $(SED) -i -r -e 's%("Content-Type: text/plain; charset=)(.*)(\\n")%\1UTF-8\3%' $(DOMAIN).pot - + $(C_POTFILES) ; \ + $(SED) '/^"POT-Creation-Date: .*"$$/d' $(DOMAIN).pot.update > $(DOMAIN).pot.update.tmp ; \ + $(SED) -i -r -e 's%("Content-Type: text/plain; charset=)(.*)(\\n")%\1UTF-8\3%' $(DOMAIN).pot.update.tmp ; \ + $(SED) '/^"POT-Creation-Date: .*"$$/d' $(DOMAIN).pot > $(DOMAIN).pot.tmp ; \ + if ! cmp -s $(DOMAIN).pot.update.tmp $(DOMAIN).pot.tmp ; then \ + echo "$(DOMAIN).pot updated" ; \ + mv $(DOMAIN).pot.update $(DOMAIN).pot ; \ + # Replace the charset with UTF-8 ; \ + $(SED) -i -r -e 's%("Content-Type: text/plain; charset=)(.*)(\\n")%\1UTF-8\3%' $(DOMAIN).pot ; \ + else \ + echo "$(DOMAIN).pot unmodified" ; \ + fi || : + @rm -f $(DOMAIN).pot.update $(DOMAIN).pot.update.tmp $(DOMAIN).pot.tmp msg-stats: @pot_count=`$(MSGFMT) --statistics $(DOMAIN).pot 2>&1 | \ @@ -238,6 +244,7 @@ install: $(mo_files) mostlyclean: rm -rf *.mo test.po test_locale + rm -f $(DOMAIN).pot.update $(DOMAIN).pot.update.tmp $(DOMAIN).pot.tmp clean: mostlyclean |