]> git.donarmstrong.com Git - lilypond.git/commitdiff
WEB: texi-langutils.py: fix @documentlanguage, make new-lang work for update.
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 12 Aug 2009 16:05:19 +0000 (18:05 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 12 Aug 2009 16:05:19 +0000 (18:05 +0200)
Documentation/GNUmakefile
scripts/auxiliar/texi-langutils.py

index e524b682ac7fd77d664308acc70f5f7417406716..640a49ca98d5bca1c768dd4518298a55635fb73b 100644 (file)
@@ -238,31 +238,25 @@ new-lang-dir:
        cp fr/GNUmakefile $(ISOLANG)
        cp fr/$(DIR)/GNUmakefile $(ISOLANG)/$(DIR)
        sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/$(DIR)/GNUmakefile
-ifeq (ugh,urgh)
-# Law of conservation of badness in action :-)
-       cd $(ISOLANG)/$(DIR) && ../../$(auxscript-dir)/texi-langutils.py -l $(ISOLANG) -o ../../$(outdir)/doc.pot --skeleton --gettext $$(ls -1 ../../$(DIR).tely ../../$(DIR).texi)
-# gets written to wrong directory; texi-langutils.py outdir/output is a mess
-       mv $(ISOLANG)/$(DIR)/$(DIR).* $(ISOLANG) || : 
-# cleanup cruft
-       rm -f $(ISOLANG)/node_list $(ISOLANG)/*/node_list
-else
+       rm -f $(outdir)/*.*tely $(outdir)/*.*texi
        $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext $$(cd $(ISOLANG) && ls -1 ../$(DIR).tely ../$(DIR).texi)
-       mv $$(ls $(outdir)/$(DIR).tely $(outdir)/$(DIR).texi) $(ISOLANG) || :
-       mv $$(ls $(outdir)/*.*tely $(outdir)/*.*texi) $(ISOLANG)/$(DIR) ||: 
-endif
+       for i in $$(cd $(outdir) && ls -1 $(DIR).tely $(DIR).texi); do\
+           test -e $(ISOLANG)/$$i || mv $(outdir)/$$i $(ISOLANG)/$$i;\
+       done
+       rm -f $(outdir)/$(DIR).tely $(outdir)/$(DIR).texi
+       for i in $$(cd $(outdir) && ls -1 *.*tely *.*texi); do\
+           test -e $(ISOLANG)/$(DIR)/$$i\
+               || mv $(outdir)/$$i $(ISOLANG)/$(DIR)/$$i;\
+       done
 
 new-lang:
-# FIXME: allow this target to update a language too
-#        do not blindly overwrite, use test -e and only create missing files
-#        for inspiration, see [old] lilypond/web GNUmakefile's target new:
-       @if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \
-       then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \
-       exit 3 ; \
-       fi
+# Also for updating/adding missing files
        $(foreach i,$(TRANSLATION_DIRS),$(MAKE) new-lang-dir DIR=$(i) &&) :
-       cd fr && cp $(EXTRA_TRANSLATION_FILES) ../$(ISOLANG)
+       $(foreach i, $(EXTRA_TRANSLATION_FILES), \
+           (test -e $(ISOLANG)/$(i) \
+               || cp fr/$(i) $(ISOLANG)/$(i)) && ) true
        msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
-       cp po/lilypond-doc.pot po/$(ISOLANG).po
+       test -e po/$(ISOLANG).po || cp po/lilypond-doc.pot po/$(ISOLANG).po
        @echo "***  Please add a language definition for $(ISOLANG) in python/langdefs.py  ***"
 
 #TRANSLATION_DIRS = $(shell git ls-files $(ISOLANG) | $(PYTHON) $(buildscript-dir)/pytt.py '/[^/]*$$' / | sort -u )
index e9798a619167c2ba925dd2277e17fe49379a983e..0080f11a62c1e32154f7561e3e031086e799c7f8 100755 (executable)
@@ -120,6 +120,8 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu
                     g.write ('@menu\n')
                 elif item[2] == 'end menu':
                     g.write ('@end menu\n\n')
+                elif item[2] == 'documentlanguage':
+                    g.write ('@documentlanguage ' + doclang + '\n')
                 else:
                     space = ' '
                     if item[3].startswith ('{') or not item[3].strip ():