Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b106195

Browse files
committed
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.
1 parent 83b7584 commit b106195

File tree

5 files changed

+11
-44
lines changed

5 files changed

+11
-44
lines changed

src/makefiles/pgxs.mk

+7-28
Original file line numberDiff line numberDiff line change
@@ -103,51 +103,30 @@ endif # MODULE_big
103103

104104
install: all installdirs
105105
ifneq (,$(EXTENSION))
106-
@for file in $(addprefix $(srcdir)/, $(addsuffix .control, $(EXTENSION))); do \
107-
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
108-
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
109-
done
106+
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(addsuffix .control, $(EXTENSION))) '$(DESTDIR)$(datadir)/extension/'
110107
endif # EXTENSION
111108
ifneq (,$(DATA)$(DATA_built))
112-
@for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \
113-
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'"; \
114-
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'; \
115-
done
109+
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) $(DATA_built) '$(DESTDIR)$(datadir)/$(datamoduledir)/'
116110
endif # DATA
117111
ifneq (,$(DATA_TSEARCH))
118-
@for file in $(addprefix $(srcdir)/, $(DATA_TSEARCH)); do \
119-
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'"; \
120-
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'; \
121-
done
112+
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA_TSEARCH)) '$(DESTDIR)$(datadir)/tsearch_data/'
122113
endif # DATA_TSEARCH
123114
ifdef MODULES
124-
@for file in $(addsuffix $(DLSUFFIX), $(MODULES)); do \
125-
echo "$(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'"; \
126-
$(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'; \
127-
done
115+
$(INSTALL_SHLIB) $(addsuffix $(DLSUFFIX), $(MODULES)) '$(DESTDIR)$(pkglibdir)/'
128116
endif # MODULES
129117
ifdef DOCS
130118
ifdef docdir
131-
@for file in $(addprefix $(srcdir)/, $(DOCS)); do \
132-
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'"; \
133-
$(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'; \
134-
done
119+
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DOCS)) '$(DESTDIR)$(docdir)/$(docmoduledir)/'
135120
endif # docdir
136121
endif # DOCS
137122
ifdef PROGRAM
138123
$(INSTALL_PROGRAM) $(PROGRAM)$(X) '$(DESTDIR)$(bindir)'
139124
endif # PROGRAM
140125
ifdef SCRIPTS
141-
@for file in $(addprefix $(srcdir)/, $(SCRIPTS)); do \
142-
echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \
143-
$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \
144-
done
126+
$(INSTALL_SCRIPT) $(addprefix $(srcdir)/, $(SCRIPTS)) '$(DESTDIR)$(bindir)/'
145127
endif # SCRIPTS
146128
ifdef SCRIPTS_built
147-
@for file in $(SCRIPTS_built); do \
148-
echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \
149-
$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \
150-
done
129+
$(INSTALL_SCRIPT) $(SCRIPTS_built) '$(DESTDIR)$(bindir)/'
151130
endif # SCRIPTS_built
152131

153132
ifdef MODULE_big

src/pl/plperl/GNUmakefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ installdirs: installdirs-lib
8282
uninstall: uninstall-lib uninstall-data
8383

8484
install-data: installdirs
85-
@for file in $(addprefix $(srcdir)/, $(DATA)); do \
86-
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
87-
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
88-
done
85+
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
8986

9087
uninstall-data:
9188
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))

src/pl/plpgsql/src/Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ installdirs: installdirs-lib
3535
uninstall: uninstall-lib uninstall-data
3636

3737
install-data: installdirs
38-
@for file in $(addprefix $(srcdir)/, $(DATA)); do \
39-
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
40-
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
41-
done
38+
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
4239

4340
uninstall-data:
4441
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))

src/pl/plpython/Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,7 @@ installdirs: installdirs-lib
114114
uninstall: uninstall-lib uninstall-data
115115

116116
install-data: installdirs
117-
@for file in $(addprefix $(srcdir)/, $(DATA)); do \
118-
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
119-
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
120-
done
117+
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
121118

122119
uninstall-data:
123120
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))

src/pl/tcl/Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ uninstall: uninstall-lib uninstall-data
6565
$(MAKE) -C modules $@
6666

6767
install-data: installdirs
68-
@for file in $(addprefix $(srcdir)/, $(DATA)); do \
69-
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
70-
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
71-
done
68+
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
7269

7370
uninstall-data:
7471
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))

0 commit comments

Comments
 (0)