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

Re: Bug#379614: devscripts: Complete update of French manpage translations with po4a

Hi guys!

Firstly thanks for the translations.  (Sadly, some of them are
already out of date :( )  I've just applied them to the new version of
devscripts, just uploaded.

I had to modify the Makefile quite a bit, though.  Here is the patch I
applied and then an explanation.  It may well apply to other packages

--- Makefile	(revision 451)
+++ Makefile	(revision 492)
@@ -25,6 +25,7 @@
 	rmadison.1 svnpath.1
 MAN5S = devscripts.conf.5
 MANS_fr_DIR = po4a/fr
+GEN_MAN1S_fr = $(patsubst %,$(MANS_fr_DIR)/%,$(GEN_MAN1S))
 MAN1S_fr = $(subst $(MANS_fr_DIR)/,,$(wildcard $(MANS_fr_DIR)/*.1))
 MAN5S_fr = $(subst $(MANS_fr_DIR)/,,$(wildcard $(MANS_fr_DIR)/*.5))
@@ -75,10 +76,17 @@
 	cd po4a && po4a --no-backups devscripts-po4a.conf
+	# These may or may not have been successfully made; we don't stop
+	# building the rest of the package in such a case
+	for i in $(GEN_MAN1S_fr); do \
+	    $(MAKE) $$i || true; \
+	done
+	touch translated_manpages
 	# Update the POT/POs and remove the translated man pages
 	cd po4a && po4a --rm-translations --no-backups devscripts-po4a.conf
+	rm -f translated_manpages
 libvfork.o: libvfork.c
 	$(CC) -fPIC -D_REENTRANT $(CFLAGS) -c $<
@@ -88,7 +96,7 @@
 clean: clean_translated_manpages
 	rm -f version conf.default $(SCRIPTS) $(GEN_MAN1S) $(SCRIPT_LIBS) \
-	    $(CWRAPPERS) libvfork.o libvfork.so.0
+	    $(GEN_MAN1S_fr) $(CWRAPPERS) libvfork.o libvfork.so.0
 install: all
 	mkdir -p $(DESTDIR)$(BINDIR)
@@ -109,10 +117,12 @@
 	cp $(MAN5S) $(DESTDIR)$(MAN5DIR)
 	cd $(DESTDIR)$(MAN1DIR) && ln -s debchange.1 dch.1
 	mkdir -p $(DESTDIR)$(MAN1DIR_fr)
-	cd $(MANS_fr_DIR) && cp $(MAN1S_fr) $(DESTDIR)$(MAN1DIR_fr)
+	-cd $(MANS_fr_DIR) && cp $(MAN1S_fr) $(DESTDIR)$(MAN1DIR_fr)
+	-cp $(GEN_MAN1S_fr) $(DESTDIR)$(MAN1DIR_fr)
 	mkdir -p $(DESTDIR)$(MAN5DIR_fr)
-	cd $(MANS_fr_DIR) && cp $(MAN5S_fr) $(DESTDIR)$(MAN5DIR_fr)
-	cd $(DESTDIR)$(MAN1DIR_fr) && ln -s debchange.1 dch.1
+	-cd $(MANS_fr_DIR) && cp $(MAN5S_fr) $(DESTDIR)$(MAN5DIR_fr)
+	cd $(DESTDIR)$(MAN1DIR_fr) && \
+	    if [ -f debchange.1 ]; then ln -s debchange.1 dch.1; fi
 	mkdir -p $(DESTDIR)$(EXAMPLES_DIR)
 #	-find $(DESTDIR) -type d -name '.svn' -exec rm -r \{\} \;

The first thing was "touch translated_manpages", which means that po4a
is not run twice.

Next, the generated manpages caused problems: what if one of the
generated pages didn't actually get generated, because it was out of
date?  So I've removed it from the all: target, and added it to the
translated_manpages target, but each individual generated manpage is
created by a separate invocation of $(MAKE), so that any individual
failures are ignored without preventing the generation of the rest of
the pages.

I've also protected the cp functions in the install target with '-' so
that if not all of the manpages are generated, the installation does
not fail.


Reply to: