* Make merge * Move merge to its own script. * No longer needed. * Use git ls-files.
This commit is contained in:
Julien Palard 2021-10-22 14:56:00 +02:00 committed by GitHub
commit 2afee90322
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,6 @@
# - make spell # To check for spelling
# - make clean # To remove build artifacts
# - make fuzzy # To find fuzzy strings
# - make merge # To merge pot from upstream
#
# Modes are: autobuild-stable, autobuild-dev, and autobuild-html,
# documented in gen/src/3.6/Doc/Makefile as we're only delegating the
@ -21,7 +20,8 @@
# from which we generated our po files. We use it here so when we
# test build, we're building with the .rst files that generated our
# .po files.
CPYTHON_CURRENT_COMMIT := d5feb2b1f12a15c1a9bac094a8f6f77d0cfcbdc2
CPYTHON_CURRENT_COMMIT := 00ddc1fbd7296ffe066077194a895b175cca26de
LANGUAGE := fr
BRANCH := 3.10
@ -128,30 +128,6 @@ fuzzy: ensure_prerequisites
.PHONY: verifs
verifs: wrap spell
.PHONY: merge
merge: ensure_prerequisites
@echo "Merge from $(UPSTREAM)"
git -C venv/cpython/ checkout $(BRANCH)
git -C venv/cpython/ pull --ff-only
(cd venv/cpython/Doc; sphinx-build -Q -b gettext -D gettext_compact=0 . ../pot)
find venv/cpython/pot/ -name '*.pot' |\
while read -r POT; \
do \
PO="./$$(echo "$$POT" | sed "s#venv/cpython/pot/##; s#\.pot\$$#.po#")"; \
mkdir -p "$$(dirname "$$PO")"; \
if [ -f "$$PO" ]; \
then \
msgmerge --backup=off --force-po -U "$$PO" "$$POT"; \
else \
msgcat -o "$$PO" "$$POT"; \
fi \
done
rm -fr venv/cpython/pot/
sed -i 's|^#: .*Doc/|#: |' *.po */*.po
powrap -m
@printf "\n%s %s\n" "Replace CPYTHON_CURRENT_COMMIT in Makefile by: " $(shell git -C venv/cpython/ rev-parse HEAD)
@printf 'To add, you can use:\n git status -s | grep "^ M .*\.po" | cut -d" " -f3 | while read -r file; do if [ $$(git diff "$$file" | wc -l) -gt 13 ]; then git add "$$file"; fi ; done\n'
.PHONY: clean
clean:
@echo "Cleaning *.mo and $(POSPELL_TMP_DIR)"