($(DOMAIN).pot-update): Remove/replace the .pot
authorJim Meyering <jim@meyering.net>
Sun, 17 Feb 2002 16:20:39 +0000 (16:20 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 17 Feb 2002 16:20:39 +0000 (16:20 +0000)
file only if the new one is different (modulo the creation date).

po/Makefile.in.in

index e955532..f68983c 100644 (file)
@@ -82,8 +82,13 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
          --files-from=$(srcdir)/POTFILES.in \
          --copyright-holder='$(COPYRIGHT_HOLDER)' \
        && test ! -f $(DOMAIN).po \
-          || ( rm -f $(srcdir)/$(DOMAIN).pot \
-               && mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot )
+          || ( if diff -u -IPOT-Creation-Date: \
+                    $(DOMAIN).po $(srcdir)/$(DOMAIN).pot>/dev/null 2>&1;then \
+                 rm -f $(DOMAIN).po; \
+               else \
+                 rm -f $(srcdir)/$(DOMAIN).pot; \
+                 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+               fi )
 
 $(srcdir)/$(DOMAIN).pot:
        $(MAKE) $(DOMAIN).pot-update