From b106195b1731ce5d68e8bb5c421f09a4aae9e96a Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 2 May 2011 00:37:07 +0300 Subject: [PATCH] Rewrite installation makefile rules without for loops install-sh can install multiple files at once, so for loops are not necessary. This was already changed for the rest of the code some time ago, but pgxs.mk was apparently forgotten, and the obsolete coding style has now been copied to the PLs as well. This also fixes the problem that the for loops in question did not catch errors. --- src/makefiles/pgxs.mk | 35 +++++++---------------------------- src/pl/plperl/GNUmakefile | 5 +---- src/pl/plpgsql/src/Makefile | 5 +---- src/pl/plpython/Makefile | 5 +---- src/pl/tcl/Makefile | 5 +---- 5 files changed, 11 insertions(+), 44 deletions(-) diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk index 7fb007fb1c..05ed8416a9 100644 --- a/src/makefiles/pgxs.mk +++ b/src/makefiles/pgxs.mk @@ -103,51 +103,30 @@ endif # MODULE_big install: all installdirs ifneq (,$(EXTENSION)) - @for file in $(addprefix $(srcdir)/, $(addsuffix .control, $(EXTENSION))); do \ - echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \ - $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \ - done + $(INSTALL_DATA) $(addprefix $(srcdir)/, $(addsuffix .control, $(EXTENSION))) '$(DESTDIR)$(datadir)/extension/' endif # EXTENSION ifneq (,$(DATA)$(DATA_built)) - @for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \ - echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'"; \ - $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'; \ - done + $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) $(DATA_built) '$(DESTDIR)$(datadir)/$(datamoduledir)/' endif # DATA ifneq (,$(DATA_TSEARCH)) - @for file in $(addprefix $(srcdir)/, $(DATA_TSEARCH)); do \ - echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'"; \ - $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'; \ - done + $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA_TSEARCH)) '$(DESTDIR)$(datadir)/tsearch_data/' endif # DATA_TSEARCH ifdef MODULES - @for file in $(addsuffix $(DLSUFFIX), $(MODULES)); do \ - echo "$(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'"; \ - $(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'; \ - done + $(INSTALL_SHLIB) $(addsuffix $(DLSUFFIX), $(MODULES)) '$(DESTDIR)$(pkglibdir)/' endif # MODULES ifdef DOCS ifdef docdir - @for file in $(addprefix $(srcdir)/, $(DOCS)); do \ - echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'"; \ - $(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'; \ - done + $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DOCS)) '$(DESTDIR)$(docdir)/$(docmoduledir)/' endif # docdir endif # DOCS ifdef PROGRAM $(INSTALL_PROGRAM) $(PROGRAM)$(X) '$(DESTDIR)$(bindir)' endif # PROGRAM ifdef SCRIPTS - @for file in $(addprefix $(srcdir)/, $(SCRIPTS)); do \ - echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \ - $(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \ - done + $(INSTALL_SCRIPT) $(addprefix $(srcdir)/, $(SCRIPTS)) '$(DESTDIR)$(bindir)/' endif # SCRIPTS ifdef SCRIPTS_built - @for file in $(SCRIPTS_built); do \ - echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \ - $(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \ - done + $(INSTALL_SCRIPT) $(SCRIPTS_built) '$(DESTDIR)$(bindir)/' endif # SCRIPTS_built ifdef MODULE_big diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile index 155b60f43f..79a8d5d3fa 100644 --- a/src/pl/plperl/GNUmakefile +++ b/src/pl/plperl/GNUmakefile @@ -82,10 +82,7 @@ installdirs: installdirs-lib uninstall: uninstall-lib uninstall-data install-data: installdirs - @for file in $(addprefix $(srcdir)/, $(DATA)); do \ - echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \ - $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \ - done + $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/' uninstall-data: rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA))) diff --git a/src/pl/plpgsql/src/Makefile b/src/pl/plpgsql/src/Makefile index 52fbc1c41a..751a98dbb0 100644 --- a/src/pl/plpgsql/src/Makefile +++ b/src/pl/plpgsql/src/Makefile @@ -35,10 +35,7 @@ installdirs: installdirs-lib uninstall: uninstall-lib uninstall-data install-data: installdirs - @for file in $(addprefix $(srcdir)/, $(DATA)); do \ - echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \ - $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \ - done + $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/' uninstall-data: rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA))) diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile index 86d8741e28..93425cdb34 100644 --- a/src/pl/plpython/Makefile +++ b/src/pl/plpython/Makefile @@ -114,10 +114,7 @@ installdirs: installdirs-lib uninstall: uninstall-lib uninstall-data install-data: installdirs - @for file in $(addprefix $(srcdir)/, $(DATA)); do \ - echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \ - $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \ - done + $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/' uninstall-data: rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA))) diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile index faffd09fd3..77c173bcd8 100644 --- a/src/pl/tcl/Makefile +++ b/src/pl/tcl/Makefile @@ -65,10 +65,7 @@ uninstall: uninstall-lib uninstall-data $(MAKE) -C modules $@ install-data: installdirs - @for file in $(addprefix $(srcdir)/, $(DATA)); do \ - echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \ - $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \ - done + $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/' uninstall-data: rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))