The following syntax is not portable to certain shells:
for f in ; do stuff; done
When no translations are installed, a command just like this is
generated in the installation rules. Instead of doing nothing
as desired, HP-UX 11 /bin/sh, heirloom-sh, and presumably also
old Solaris /bin/sh will exit with an error.
To work around this problem, we can stuff the list into a shell
variable and then use that in the for loop.
-# Copyright © 2011-2012 Nick Bowler
+# Copyright © 2011-2012, 2023 Nick Bowler
#
# Automake fragment to distribute and install gettext .po/.mo files, intended
# for use in a non-recursive build setup. This does not include rules to
#
# Automake fragment to distribute and install gettext .po/.mo files, intended
# for use in a non-recursive build setup. This does not include rules to
install-data-local: install-mofiles
install-mofiles: $(MOFILES)
install-data-local: install-mofiles
install-mofiles: $(MOFILES)
- for mo in $?; do \
- lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
- test x"$$lang" = x"" && exit 1; \
- inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
- (set -x; $(MKDIR_P) "$$inst") \
- || exit $$?; \
- (set -x; $(INSTALL_DATA) "$$mo" "$$inst/$(PACKAGE).mo") \
- || exit $$?; \
+ mos='$?'; for mo in $$mos; do \
+ lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
+ test x"$$lang" = x"" && exit 1; \
+ inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
+ (set -x; $(MKDIR_P) "$$inst") || exit; \
+ (set -x; $(INSTALL_DATA) "$$mo" "$$inst/$(PACKAGE).mo") || exit; \
done
.PHONY: install-mofiles
installdirs-local: installdirs-mofiles
installdirs-mofiles:
done
.PHONY: install-mofiles
installdirs-local: installdirs-mofiles
installdirs-mofiles:
- for mo in $(MOFILES); do \
- lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
- test x"$$lang" = x"" && exit 1; \
- inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
- (set -x; $(MKDIR_P) "$$inst") || exit $$?; \
+ mos='$(MOFILES)'; for mo in $$mos; do \
+ lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
+ test x"$$lang" = x"" && exit 1; \
+ inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
+ (set -x; $(MKDIR_P) "$$inst") || exit; \
done
.PHONY: installdirs-mofiles
uninstall-local: uninstall-mofiles
uninstall-mofiles:
done
.PHONY: installdirs-mofiles
uninstall-local: uninstall-mofiles
uninstall-mofiles:
- for mo in $(ALL_MOFILES); do \
- lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
- test x"$$lang" = x"" && exit 1; \
- inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
- (set -x; cd "$$inst" && rm -f '$(PACKAGE).mo'); \
+ mos='$(ALL_MOFILES)'; for mo in $$mos; do \
+ lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
+ test x"$$lang" = x"" && exit 1; \
+ inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
+ (set -x; cd "$$inst" && rm -f '$(PACKAGE).mo'); \
done
.PHONY: uninstall-mofiles
done
.PHONY: uninstall-mofiles