Project

General

Profile

« Previous | Next » 

Revision 8463

lib/util.run: echo_func (): use the caller's FUNCNAME via the $FUNCNAME[] array instead of requiring them to pass it in the function args as `echo_func "$FUNCNAME" "$@"`

View differences:

table.run
6 6

  
7 7
import ()
8 8
{
9
	echo_func "$FUNCNAME" "$@"
9
	echo_func "$@"
10 10
	before_import_cmds
11 11
	"$(dirname "${BASH_SOURCE[0]}")"/path/to/table.run "$FUNCNAME" "$@"
12 12
	after_import_cmds
......
24 24

  
25 25
psql () # usage: ([file=...] [dir=...]; self)
26 26
{
27
	echo_func "$FUNCNAME" "$@"
27
	echo_func "$@"
28 28
	local dir="$dir"
29 29
	if test -n "$file"; then
30 30
		set -- --file "$file" "$@"
......
45 45

  
46 46
input_make ()
47 47
{
48
	echo_func "$FUNCNAME" "$@"
48
	echo_func "$@"
49 49
	echo_run env make --directory="$top_dir"/.. "${@/#/$table/}"
50 50
}
51 51

  
52 52
map_table ()
53 53
{
54
	echo_func "$FUNCNAME" "$@"
54
	echo_func "$@"
55 55
	input_make map.csv
56 56
	psql <<EOF
57 57
SELECT util.reset_map_table('pg_temp.map');
......
62 62

  
63 63
mk_derived ()
64 64
{
65
	echo_func "$FUNCNAME" "$@"
65
	echo_func "$@"
66 66
	"$root_dir"/schemas/VegCore/mk_derived
67 67
}
68 68

  
69 69
remake_VegBIEN_mappings ()
70 70
{
71
	echo_func "$FUNCNAME" "$@"
71
	echo_func "$@"
72 72
	echo_run rm header.csv map.csv # remake them
73 73
	yes|input_make test
74 74
}
75 75

  
76 76
postprocess () # overridable
77 77
{
78
	echo_func "$FUNCNAME" "$@"
78
	echo_func "$@"
79 79
	local file="$top_dir"/postprocess.sql
80 80
	if test -e "$file"; then psql "$@"; fi
81 81
}
82 82

  
83 83
import ()
84 84
{
85
	echo_func "$FUNCNAME" "$@"
85
	echo_func "$@"
86 86
	map_table
87 87
	postprocess
88 88
	mk_derived

Also available in: Unified diff