Project

General

Profile

1 8654 aaronmk
#!/bin/bash -e
2
# syncs VegCore.ERD.mwb's zip file contents
3 8774 aaronmk
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/runscripts/util.run
4 8927 aaronmk
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/local.sh
5 8654 aaronmk
6 8705 aaronmk
if self_not_included; then
7
8 8654 aaronmk
export archive="${BASH_SOURCE[0]%.run}"
9
10
export archive_filename="$(basename "$archive")"
11
12 8926 aaronmk
VegCore.my.sql/make ()
13
{
14
	echo_func; set_make_vars
15
	database=VegCore mysqldump_local >"$target"
16
}
17
18
export_mysql ()
19
{
20
	echo_func
21
	VegCore.my.sql/make
22
}
23
24 8931 aaronmk
VegCore.pg.sql/make ()
25
{
26
	echo_func; set_make_vars
27
	my2pg <"${target%.pg.sql}.my.sql" >"$target"
28
}
29
30
export_postgres ()
31
{
32
	echo_func
33
	VegCore.pg.sql/make
34
}
35
36 8654 aaronmk
export_ ()
37
{
38 8881 aaronmk
	echo_func
39 8655 aaronmk
	(cd "$top_dir"
40 8660 aaronmk
	unzip_newer "$archive_filename" document.mwb.xml)
41 8926 aaronmk
	export_mysql
42 8931 aaronmk
	export_postgres
43 8654 aaronmk
}
44
45
import ()
46
{
47 8881 aaronmk
	echo_func
48 8655 aaronmk
	(cd "$top_dir"
49 8660 aaronmk
	zip_newer "$archive_filename" document.mwb.xml)
50 8654 aaronmk
}
51
52
sync ()
53
{
54 8881 aaronmk
	echo_func
55 8654 aaronmk
	export_ "$@"
56
	import "$@"
57
}
58
59
all ()
60
{
61 8881 aaronmk
	echo_func
62 8654 aaronmk
	sync
63
}
64 8705 aaronmk
65
fi