Project

General

Profile

« Previous | Next » 

Revision 9585

lib/runscripts/table_dir.run: renamed table to subdir because this can apply to any datasrc subdir. moved table-specific code to table.run.

View differences:

lib/runscripts/table_dir.run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/util.run
3
. "$(dirname "${BASH_SOURCE[0]}")"/../sh/local.sh
4

  
5
if self_not_included; then
6

  
7
: "${schema="$(log+ 2 cd "$top_dir"/..; basename "$PWD")"}"
8
: "${table="$( log+ 2 cd "$top_dir"   ; basename "$PWD")"}"
9
export schema table
10

  
11
table_make()
12
# requires Makefile in datasrc dir with `include ../input.Makefile`
13
# target names are relative to the table subdir itself, not the datasrc dir
14
{
15
	echo_func
16
	make --directory="$(canon_rel_path "$top_dir"/..)" "${@/#/$table/}"
17
	# "${@/#/$table/}": replaces empty str at beginning of str (/#) with $table/
18
}
19

  
20
fi
21 0

  
lib/runscripts/table.run
15 15
fi ####
16 16

  
17 17
. "$(dirname "${BASH_SOURCE[0]}")"/import.run
18
. "$(dirname "${BASH_SOURCE[0]}")"/table_dir.run
18
. "$(dirname "${BASH_SOURCE[0]}")"/subdir.run
19 19

  
20 20
if self_not_included; then
21 21

  
22
: "${table=$subdir}"; export table
23

  
24
table_make() { subdir_make "$@"; }
25

  
22 26
map_table()
23 27
{
24 28
	echo_func
lib/runscripts/subdir.run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/util.run
3
. "$(dirname "${BASH_SOURCE[0]}")"/../sh/local.sh
4

  
5
if self_not_included; then
6

  
7
: "${schema="$(log+ 2 cd "$top_dir"/..; basename "$PWD")"}"
8
: "${subdir="$(log+ 2 cd "$top_dir"   ; basename "$PWD")"}"
9
export schema subdir
10

  
11
subdir_make()
12
# requires Makefile in datasrc dir with `include ../input.Makefile`
13
# target names are relative to the subdir itself, not the datasrc dir
14
{
15
	echo_func
16
	make --directory="$(canon_rel_path "$top_dir"/..)" "${@/#/$subdir/}"
17
	# "${@/#/$subdir/}": replaces empty str at start of str (/#) with $subdir/
18
}
19

  
20
fi
0 21

  

Also available in: Unified diff