guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: Makefile.am: Add check-po rule.


From: guix-commits
Subject: 02/03: Makefile.am: Add check-po rule.
Date: Thu, 28 Jan 2021 10:41:30 -0500 (EST)

roptat pushed a commit to branch master
in repository guix.

commit b91165460e71f427c30f22ace02a5d775ecea23d
Author: Julien Lepiller <julien@lepiller.eu>
AuthorDate: Fri Jan 22 21:24:23 2021 +0100

    Makefile.am: Add check-po rule.
    
    * Makefile.am (make-check-po-rule): New definition.
    Add top-level 'eval' and calls to 'make-check-po-rule' to generate
    'check-po.DOMAIN' rules.
    (check-po): New rule.
---
 Makefile.am | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index d479032..ee05d79 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1003,14 +1003,49 @@ download-po.$(1):
 
 endef
 
+# Checking po files for issues.  This is useful to run after downloading new
+# po files.
+
+# make-check-po-rule DOMAIN DIRECTORY [FILE-NAME-PREFIX]
+define make-check-po-rule
+
+check-po.$(1):
+       if [ -f "$(top_srcdir)/$(2)/LINGUAS" ]; then                            
\
+         LINGUAS="`grep -v '^[[:blank:]]*#' < $(top_srcdir)/$(2)/LINGUAS`" ;   
\
+       else                                                                    
\
+         LINGUAS="`(cd $(top_srcdir)/$(2);                                     
\
+           for i in *.po; do echo $$$$i; done) | cut -d . -f 2`" ;             
\
+       fi ;                                                                    
\
+       for lang in $$$$LINGUAS; do                                             
\
+         if [ -f "$(top_srcdir)/$(2)/$(3)$$$$lang.po" ];                       
\
+         then                                                                  
\
+           if ! msgfmt -c "$(top_srcdir)/$(2)/$(3)$$$$lang.po" ;               
\
+               then                                                            
\
+                 exit 1 ;                                                      
\
+           fi ;                                                                
\
+         fi ;                                                                  
\
+       done
+
+.PHONY: check-po.$(1)
+
+endef
+
 $(eval $(call 
make-download-po-rule,documentation-cookbook,po/doc,guix-cookbook.))
 $(eval $(call make-download-po-rule,documentation-manual,po/doc,guix-manual.))
 $(eval $(call make-download-po-rule,guix,po/guix))
 $(eval $(call make-download-po-rule,packages,po/packages))
 
+$(eval $(call make-check-po-rule,documentation-cookbook,po/doc,guix-cookbook.))
+$(eval $(call make-check-po-rule,documentation-manual,po/doc,guix-manual.))
+$(eval $(call make-check-po-rule,guix,po/guix))
+$(eval $(call make-check-po-rule,packages,po/packages))
+
 download-po: $(foreach domain,guix packages documentation-manual 
documentation-cookbook,download-po.$(domain))
 .PHONY: download-po
 
+check-po: $(foreach domain,guix packages documentation-manual 
documentation-cookbook,check-po.$(domain))
+.PHONY: check-po
+
 ## -------------- ##
 ## Silent rules.  ##
 ## -------------- ##



reply via email to

[Prev in Thread] Current Thread [Next in Thread]