@@ -22,20 +22,20 @@ LC_MESSAGES := $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
2222VENV := ~/.venvs/python-docs-i18n/
2323PYTHON := $(shell which python3)
2424MODE := autobuild-dev-html
25- BRANCH = $(shell git describe --contains --all HEAD)
25+ BRANCH : = $(or $( VERSION ) , $( shell git describe --contains --all HEAD) )
2626JOBS = 1
2727
2828
2929.PHONY : all
30- all : $(VENV ) /bin/sphinx-build $(VENV ) /bin/blurb $( SPHINX_CONF )
30+ all : $(VENV ) /bin/sphinx-build $(VENV ) /bin/blurb clone
3131 mkdir -p $(LC_MESSAGES )
3232 for dirname in $$ (find . -name ' *.po' | xargs -n1 dirname | sort -u | grep -v ' ^\.$$' ); do mkdir -p $( LC_MESSAGES) /$$ dirname; done
3333 for file in * .po * /* .po; do ln -f $$ file $( LC_MESSAGES) /$$ file; done
3434 . $(VENV ) /bin/activate; $(MAKE ) -C $(CPYTHON_CLONE ) /Doc/ SPHINXOPTS=' -j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE )
3535
3636
37- $( SPHINX_CONF ) :
38- git clone --depth 1 --no-single-branch https://github.com/python/cpython.git $(CPYTHON_CLONE )
37+ clone :
38+ git clone --depth 1 --no-single-branch https://github.com/python/cpython.git $(CPYTHON_CLONE ) || echo " cpython exists "
3939 cd $(CPYTHON_CLONE ) && git checkout $(BRANCH )
4040
4141
@@ -84,11 +84,11 @@ endif
8484 if [ -f "$$PO" ];\
8585 then\
8686 case "$$POT" in\
87- *whatsnew*) msgmerge --backup=off --force-po --no-fuzzy-matching -U "$$PO" "$$POT" ;;\
88- *) msgmerge --backup=off --force-po -U "$$PO" "$$POT" ;;\
87+ *whatsnew*) msgmerge --lang=$(LANGUAGE) -- backup=off --force-po --no-fuzzy-matching -U "$$PO" "$$POT" ;;\
88+ *) msgmerge --lang=$(LANGUAGE) -- backup=off --force-po -U "$$PO" "$$POT" ;;\
8989 esac\
9090 else\
91- msgcat -o "$$PO" "$$POT";\
91+ msgcat --lang=$(LANGUAGE) - o "$$PO" "$$POT";\
9292 fi\
9393 done
9494
@@ -104,3 +104,7 @@ update_txconfig:
104104.PHONY : fuzzy
105105fuzzy :
106106 for file in * .po * /* .po; do echo $$ (msgattrib --only-fuzzy --no-obsolete " $$ file" | grep -c ' #, fuzzy' ) $$ file; done | grep -v ^0 | sort -gr
107+
108+ .PHONY : rm_cpython
109+ rm_cpython :
110+ rm -rf $(CPYTHON_CLONE )
0 commit comments