Project

General

Profile

« Previous | Next » 

Revision 12968

*{.sh,run}: runscript targets: use begin_target instead of echo_func so the target name is properly echoed. note that this requires using with_rm so that $rm is properly progagated to applicable invoked targets. (previously, $rm was progagated to all invoked targets. note that with_rm only works inside a runscript target that starts with begin_target.)

View differences:

trunk/inputs/test_taxonomic_names/_scrub/run
9 9

  
10 10
exports/make()
11 11
{
12
	echo_func
12
	begin_target
13 13
	(schema=public.$schema
14 14
		cols=(taxonverbatim_id taxonlabel_id taxonname); \
15 15
pg_export_tables_to_dir taxonverbatim
......
23 23

  
24 24
export_()
25 25
{
26
	echo_func
27
	exports/make
26
	begin_target
27
	with_rm exports/make
28 28
}
29 29

  
30 30
fi
trunk/inputs/.geoscrub/geoscrub_output/geoscrub.csv.run
7 7

  
8 8
export_() # usage: rm=1 .../self.run export_
9 9
{
10
	echo_func
10
	begin_target
11 11
	local_export database=geoscrub table=geoscrub \
12 12
cols='decimallatitude,decimallongitude,country,stateprovince,county,countrystd'\
13 13
',stateprovincestd,countystd,latlonvalidity,countryvalidity,'\
......
17 17

  
18 18
make() # usage: rm=1 .../self.run make
19 19
{
20
	echo_func
20
	begin_target
21 21
	local input_path="$(canon_rel_path "$root_dir/exports/geoscrub_input.csv")"
22 22
	DATAFILE="$(basename "$input_path")" command \
23 23
		"$root_dir/derived/biengeo/geoscrub.sh" \
24 24
		--geoscrub-input="$(dirname "$input_path")"
25 25
		# runtime: 2.5 h ("21:24:02" - "19:04:58")
26
	export_
26
	with_rm export_
27 27
}
28 28

  
29 29
# upload time: 30 s ("0:00:29")
30 30

  
31 31
all() # usage: rm=1 .../self.run
32 32
{
33
	echo_func
34
	make
33
	begin_target
34
	with_rm make
35 35
}
36 36

  
37 37
fi
trunk/inputs/GBIF/_MySQL/run
16 16

  
17 17
load_data() # usage: [database=GBIF_new] load_data
18 18
{
19
	echo_func
19
	begin_target
20 20
	
21 21
	use_local_remote
22 22
	database= mysql_root <<EOF
......
33 33

  
34 34
import()
35 35
{
36
	echo_func
36
	begin_target
37 37
	top_make
38 38
}
39 39

  
trunk/inputs/CVS/_src/cvs-eep-archive-2013-10-22-VegBIEN.schema.sql.run
6 6

  
7 7
cleanup() # makes the SQL suitable for PostgreSQL
8 8
{
9
	echo_func
9
	begin_target
10 10
	echo_run in_place "$top_file" $sed_cmd \
11 11
	-e 's! (BOOLEAN) ! /*\1*/INTEGER !' \
12 12
	-e 's! (DOUBLE PRECISION) (NULL) ! \1 /*\2*/ !'
......
14 14

  
15 15
all()
16 16
{
17
	echo_func
18
	cleanup
17
	begin_target
18
	with_rm cleanup
19 19
}
20 20

  
21 21
fi
trunk/inputs/FIA/_src/run
6 6

  
7 7
import()
8 8
{
9
	echo_func
10
	"$top_dir"/download
9
	begin_target
10
	with_rm "$top_dir"/download
11 11
}
12 12

  
13 13
fi
trunk/inputs/VegBank/verify/input_cols.include.txt.run
6 6

  
7 7
filter()
8 8
{
9
	echo_func
9
	begin_target
10 10
	<"${top_file/.include./.}" echo_run filter_out_cs 0 \
11 11
	<(sed 's/ #.*$//' "${top_file/.include./.exclude.}") >"$top_file"
12 12
}
13 13

  
14 14
all()
15 15
{
16
	echo_func
17
	filter
16
	begin_target
17
	with_rm filter
18 18
}
19 19

  
20 20
fi
trunk/inputs/VegBank/verify/input_cols.exclude.txt.run
6 6

  
7 7
filter()
8 8
{
9
	echo_func
9
	begin_target
10 10
	<"${top_file/.exclude./.}" echo_run grep -F -e '--' -e '#'\
11 11
	|sed 's/^OMIT#.*$/& # included as part of another table/' >"$top_file"
12 12
}
13 13

  
14 14
all()
15 15
{
16
	echo_func
17
	filter
16
	begin_target
17
	with_rm filter
18 18
}
19 19

  
20 20
fi
trunk/schemas/VegCore/VegCore.pg.sql.run
7 7

  
8 8
install()
9 9
{
10
	echo_func
10
	begin_target
11 11
	root_make schemas/temp/reinstall
12 12
	psql_script_vegbien <"$top_file"
13 13
}
14 14

  
15 15
all()
16 16
{
17
	echo_func
18
	install
17
	begin_target
18
	with_rm install
19 19
}
20 20

  
21 21
fi
trunk/schemas/VegCore/ERD/VegCore.ERD.mwb.run
31 31

  
32 32
export_mysql()
33 33
{
34
	echo_func
35
	../VegCore.my.sql/make
34
	begin_target
35
	with_rm ../VegCore.my.sql/make
36 36
}
37 37

  
38 38
../VegCore.pg.sql/make()
......
43 43

  
44 44
export_postgres()
45 45
{
46
	echo_func
47
	../VegCore.pg.sql/make
46
	begin_target
47
	with_rm ../VegCore.pg.sql/make
48 48
}
49 49

  
50 50
export_()
51 51
{
52
	echo_func
52
	begin_target
53 53
	(cd "$top_dir"; unzip_newer "$top_filename" document.mwb.xml)
54
	export_mysql
55
	export_postgres
54
	with_rm export_mysql
55
	with_rm export_postgres
56 56
}
57 57

  
58 58
import()
59 59
{
60
	echo_func
60
	begin_target
61 61
	(cd "$top_dir"; zip_newer "$top_filename" document.mwb.xml)
62 62
}
63 63

  
64 64
sync()
65 65
{
66
	echo_func
67
	export_
66
	begin_target
67
	with_rm export_
68 68
	import
69 69
}
70 70

  
71 71
all()
72 72
{
73
	echo_func
74
	sync
73
	begin_target
74
	with_rm sync
75 75
}
76 76

  
77 77
fi
trunk/schemas/VegCore/ERD/VegCore.ERD.png.map.htm.run
35 35

  
36 36
all()
37 37
{
38
	echo_func
39
	cleanup
40
	header.htm/make
38
	begin_target
39
	with_rm cleanup
40
	with_rm header.htm/make
41 41
}
42 42

  
43 43
fi
trunk/run
17 17

  
18 18
export_()
19 19
{
20
	echo_func
21
	taxon_trait/make
22
	"$exports_dir"/geoscrub_input.csv.run export_
20
	begin_target
21
	with_rm taxon_trait/make
22
	with_rm "$exports_dir"/geoscrub_input.csv.run export_
23 23
}
24 24

  
25 25
fi
trunk/exports/2013-10-18.Brian_Enquist.Canadensys.csv.run
5 5

  
6 6
func_override export___extract_run
7 7
export_() # runtime: 35 min ("04:08:45" - "03:33:40")
8
{ echo_func; export___extract_run "$@"; }
8
{ begin_target; with_rm export___extract_run "$@"; }
9 9

  
10 10
on_exit
trunk/lib/runscripts/data.pg.sql.run
7 7

  
8 8
func_override export___file.pg.sql.run
9 9
export_() # usage: rm=1 .../file.run export_
10
{ echo_func; data=1 export___file.pg.sql.run; }
10
{ begin_target; data=1 with_rm export___file.pg.sql.run; }
11 11

  
12 12
fi
trunk/lib/runscripts/util.run
83 83
,() # usage: .../run , cmd1 cmd2 ... (like `make cmd1 cmd2 ...`)
84 84
# treats each of the command-line args as commands the way make does
85 85
# (instead of as args to the same command, the way runscripts do)
86
{ echo_func; for cmd in "$@"; do time echo_run "$cmd"; done; }
86
{ begin_target; for cmd in "$@"; do time with_rm echo_run "$cmd"; done; }
87 87

  
88 88
: "${auto_ignore=}" #usage: auto_ignore=1 .../__.run target_that_might_not_exist
89 89
unexport auto_ignore # don't pass this to invoked scripts except through fwd()
trunk/lib/runscripts/table.run
7 7
func_override import__table_run
8 8
import()
9 9
{
10
	echo_func
10
	begin_target
11 11
	before_import_cmds
12 12
	with_rm import__table_run "$@"
13 13
	after_import_cmds
trunk/lib/runscripts/pg.conf.run
8 8

  
9 9
install()
10 10
{
11
	echo_func
11
	begin_target
12 12
	root_make postgres_reload
13 13
}
14 14

  
trunk/lib/runscripts/mysql.table.run
38 38

  
39 39
export_mysql()
40 40
{
41
	echo_func
42
	table.tsv/make
41
	begin_target
42
	with_rm table.tsv/make
43 43
}
44 44

  
45 45
archive="$top_dir"/_archive/
trunk/lib/runscripts/import_subset.run
8 8

  
9 9
all() # usage: inputs=(inputs/{src1,src2,...}/); ...
10 10
{
11
	echo_func; : "${inputs:?}"
11
	begin_target; : "${inputs:?}"
12 12
	require_dot_script || return
13 13
	
14 14
	backup= . "$bin_dir"/import_all
trunk/lib/runscripts/schema.pg.sql.run
7 7

  
8 8
func_override export___file.pg.sql.run
9 9
export_() # usage: rm=1 .../file.run export_
10
{ echo_func; struct=1 export___file.pg.sql.run "$@"; }
10
{ begin_target; struct=1 with_rm export___file.pg.sql.run "$@"; }
11 11

  
12 12
fi
trunk/lib/runscripts/install.run
6 6

  
7 7
install()
8 8
{
9
	echo_func
9
	begin_target
10 10
	install_cmds
11 11
}
12 12
fi ####
......
17 17

  
18 18
install()
19 19
{
20
	echo_func
20
	begin_target
21 21
}
22 22

  
23 23
all()
24 24
{
25
	echo_func
26
	install
25
	begin_target
26
	with_rm install
27 27
}
28 28

  
29 29
fi
trunk/lib/runscripts/extract.run
12 12
	table="$extract_view" to_top_file pg_export
13 13
}
14 14

  
15
export_sample() { echo_func; n=100 export_; }
15
export_sample() { begin_target; n=100 with_rm export_; }
16 16

  
17 17
fi
trunk/lib/runscripts/import.run
6 6

  
7 7
import()
8 8
{
9
	echo_func
9
	begin_target
10 10
	import_cmds
11 11
}
12 12
fi ####
......
17 17

  
18 18
import()
19 19
{
20
	echo_func
20
	begin_target
21 21
}
22 22

  
23 23
export_()
24 24
{
25
	echo_func
25
	begin_target
26 26
}
27 27

  
28 28
all()
29 29
{
30
	echo_func
30
	begin_target
31 31
	import
32
	export_
32
	with_rm export_
33 33
}
34 34

  
35 35
fi
trunk/lib/sh/resume_import.sh
79 79

  
80 80
resume_import() # usage: [pos=#] resume_import
81 81
{
82
	echo_func; kw_params pos
82
	begin_target; kw_params pos
83 83
	if ! isset pos; then local pos; pos="$(import_resume_pos)"; fi
84 84
	
85 85
	^.preamble.sql/make
trunk/web/links/index.htm.run
7 7

  
8 8
clean_up()
9 9
{
10
	echo_func
10
	begin_target
11 11
	command in_place "$top_file" repl \
12 12
	"$root_dir"/lib/Firefox_bookmarks.reformat.csv
13 13
	command in_place "$top_file" $sed_cmd \
......
18 18

  
19 19
all()
20 20
{
21
	echo_func
21
	begin_target
22 22
	clean_up
23 23
}
24 24

  

Also available in: Unified diff