Project

General

Profile

« Previous | Next » 

Revision 5793

input.Makefile: Staging tables installation: Moved custom cleanup.sql cleanup operations to main $(cleanup) function, so custom cleanup operations would run whenever any target (such as %/install) invokes $(cleanup), not just manually through %/cleanup

View differences:

input.Makefile
214 214
%.sql: _MySQL/%.sql
215 215
	$(bin)/my2pg <$< >$@
216 216

  
217
cleanup = (prefix=; . $(bin)/vegbien_dest; env schema=$(datasrc) table=$*\
218
$(bin)/csv2db) $(logInstall*Add)
217
define cleanup
218
(prefix=; . $(bin)/vegbien_dest; env schema=$(datasrc) table=$* $(bin)/csv2db) \
219
$(logInstall*Add)
220
$(if $(wildcard $*/cleanup.sql),($(inDatasrc); cat $*/cleanup.sql;)|"time" \
221
$(psqlAsBien) --echo-all --set=table='"$*"' $(logInstall*Add),$(cleanup))
222
endef
219 223

  
220 224
define exportHeader
221 225
$(cleanup)
......
247 251
# This occurs because ALTER TABLE recreates the index but not its comment.
248 252
%/cleanup: _always
249 253
	$(cleanup)
250
	$(if $(wildcard $*/cleanup.sql),($(inDatasrc); cat $*/cleanup.sql;)\
251
|"time" $(psqlAsBien) --echo-all --set=table='"$*"' $(logInstall*Add))
252 254

  
253 255
##### Maps building
254 256

  

Also available in: Unified diff