Project

General

Profile

« Previous | Next » 

Revision 4450

input.Makefile: Staging tables installation: Treat empty subdirs as referencing an already-installed staging table, and run cleanup and header export operations on them

View differences:

inputs/input.Makefile
155 155
##### Sources
156 156

  
157 157
srcs = $(call sortFilenames,$(call srcsOnly,$(wildcard $*/*)))
158
isCsv = $(if $(srcs),$(if $(filter %.xml,$(srcs)),,1))
158
nonHeaderSrcs = $(filter-out %/header.csv,$(srcs))
159
isRef = $(if $(nonHeaderSrcs),,1)
160
    # empty subdir, so references an already-installed staging table
161
isCsv = $(if $(nonHeaderSrcs),$(if $(filter %.xml,$(nonHeaderSrcs)),,1))
159 162
    # true if $(srcs) non-empty and contains no *.xml
160 163
catSrcs = $(bin)/cat$(if $(isCsv),_csv) $(srcs)
161 164
withCatSrcs = $(catSrcs:$(bin)/%=$(bin)/with_%) --
......
225 228
hasRowNum = $(if $(isJoinedTable),,1)
226 229

  
227 230
%/install: _always
228
	$(if $(isCsv),$(import_install_))
231
	$(if $(isCsv),$(import_install_),$(if $(isRef),$(exportHeader)))
229 232
import_install_ = (prefix=; . $(bin)/vegbien_dest; "time" nice -n +5\
230 233
env schema=$(datasrc) table=$* has_row_num=$(hasRowNum) $(bin)/csv2db\
231 234
$(catSrcs) $(if $(log),$(if $(quiet),&>,2>&1|tee )$*/logs/install.log.sql))

Also available in: Unified diff