From 681af17460fa34916ac40589cccdcca7222249af Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 24 Dec 2020 15:50:54 +0000 Subject: guix: Move narinfo code from substitute script to module. This separation between the code for dealing with narinfos from the code doing that for a purpose should make things clearer, and better support components other that the substitute script in using this code. This is just moving the code around, no code should have been significantly changed. * guix/scripts/substitute.scm (): Move record type to (guix narinfo). (fields->alist, narinfo-hash-algorithm+value, narinfo-hash->sha256, narinfo-signature->canonical-sexp, narinfo-maker, read-narinfo, narinfo-sha256, valid-narinfo?, write-narinfo, narinfo->string, string->narinfo, equivalent-narinfo?, supported-compression?, compresses-better?, narinfo-best-uri): Move procedures to (guix narinfo). (%compression-methods): Move variable to (guix narinfo). * guix/narinfo.scm: New file. * Makefile.am (MODULES): Add it. * po/guix/POTFILES.in: Add 'guix/narinfo.scm'. --- Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 99bdcfa346..5dcd3c6fd3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -103,6 +103,7 @@ MODULES = \ guix/profiles.scm \ guix/serialization.scm \ guix/nar.scm \ + guix/narinfo.scm \ guix/derivations.scm \ guix/grafts.scm \ guix/repl.scm \ -- cgit 1.4.1 From ddfcc2141ed62307b0d8aeed7456254bb48d4dd9 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 12 Jan 2021 15:35:29 +0100 Subject: Makefile.am: Download po files from weblate. * Makefile.am (download-po): Download from weblate. --- Makefile.am | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 5dcd3c6fd3..8a8133d669 100644 --- a/Makefile.am +++ b/Makefile.am @@ -988,7 +988,7 @@ download-po.$(1): fi ; \ for lang in $$$$LINGUAS; do \ if wget -nv -O "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \ - "https://translationproject.org/latest/$(1)/$$$$lang.po" ; \ + "https://translate.fedoraproject.org/api/translations/guix/$(1)/$$$$lang/file/" ; \ then \ mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp,} ; \ else \ @@ -1000,11 +1000,12 @@ download-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,guix-packages,po/packages)) -$(eval $(call make-download-po-rule,guix-manual,po/doc,guix-manual.)) +$(eval $(call make-download-po-rule,packages,po/packages)) -download-po: $(foreach domain,guix guix-packages guix-manual,download-po.$(domain)) +download-po: $(foreach domain,guix packages documentation-manual documentation-cookbook,download-po.$(domain)) .PHONY: download-po ## -------------- ## -- cgit 1.4.1 From c891e7c828d21530f110c04dabe70515447c7d67 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 22 Jan 2021 21:28:28 +0100 Subject: Makefile.am: Normalize downloaded po files. * Makefile.am (make-download-po-rule): Normalize po files. --- Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 8a8133d669..d479032f83 100644 --- a/Makefile.am +++ b/Makefile.am @@ -990,7 +990,10 @@ download-po.$(1): if wget -nv -O "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \ "https://translate.fedoraproject.org/api/translations/guix/$(1)/$$$$lang/file/" ; \ then \ - mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp,} ; \ + msgfilter --no-wrap -i "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \ + cat > "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp2" ; \ + rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \ + mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp2,} ; \ else \ rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \ fi ; \ -- cgit 1.4.1 From b91165460e71f427c30f22ace02a5d775ecea23d Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 22 Jan 2021 21:24:23 +0100 Subject: 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(+) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index d479032f83..ee05d79ca0 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. ## ## -------------- ## -- cgit 1.4.1