Project

General

Profile

« Previous | Next » 

Revision 12795

fix: inputs/input.Makefile: removed no longer used special handling of XML inputs, support for which was never added to the Makefile. (bin/map, however, does support importing an XML file into a database.) this fixes a bug in XAL, which used to abort with an error but now just imports an empty table.

View differences:

trunk/inputs/input.Makefile
185 185
nonHeaderSrcs = $(filter-out %/header.csv,$(srcs))
186 186
isRef = $(if $(nonHeaderSrcs),,1)
187 187
    # empty subdir, so references an already-installed staging table
188
isXml = $(filter %.xml,$(nonHeaderSrcs))
189
nonXml = $(if $(isXml),,1)
190
isCsv = $(if $(nonHeaderSrcs),$(if $(isXml),,1))
191
    # true if $(srcs) non-empty and contains no *.xml
192
catSrcs = $(bin)/cat$(if $(nonXml),_csv) $(nonHeaderSrcs)
188
catSrcs = $(bin)/cat_csv $(nonHeaderSrcs)
193 189
withCatSrcs = $(catSrcs:$(bin)/%=$(bin)/with_%) --
194 190

  
195 191
# Run with `make -s` to avoid echoing make commands
......
313 309
	$(cleanup)
314 310

  
315 311
%/install: _always
316
	$(if $(isCsv),$(import_install_))
312
	$(import_install_)
317 313
	$(selfMake) "$*/postprocess"
318 314
	$(exportHeader)
319
	$(if $(isCsv),,$(cleanup))
315
	$(cleanup)
320 316
define import_install_
321 317
(. $(bin)/vegbien_dest; unset schemas; "time" nice -n +5\
322 318
env schema=$(datasrc) table=$* $(bin)/csv2db $(catSrcs) $(logInstall*))
......
371 367
	+$(selfMake) $(@:%/map.csv=%/.map.csv.last_cleanup)
372 368
define mk_map_csv
373 369
+$(selfMake) "$*/header.csv"
374
$(if $(nonXml),$(mkSrcMap))
370
$(mkSrcMap)
375 371
endef
376 372
endif
377 373

  
......
565 561
# Requires staging tables. To create them, run `make inputs/<datasrc>/install`.
566 562
# Non-flat-file inputs fall back to mimicking a successful test
567 563
%/test.xml: %/VegBIEN.csv _always
568
	$(if $(nonXml),$(call runTest,by_col=))
564
	$(call runTest,by_col=)
569 565
tests += %/test.xml
570 566

  
571 567
%/test.by_col.xml: %/VegBIEN.csv _always
572
	$(if $(nonXml),$(call runTest,by_col=1))
568
	$(call runTest,by_col=1)
573 569

  
574 570
# Only run column-based tests if column-based mode enabled, because these tests
575 571
# are much slower than the row-based tests for small numbers of rows

Also available in: Unified diff