Project

General

Profile

1
#!/bin/bash -e
2
# syncs VegCore.ERD.mwb's zip file contents
3
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/runscripts/util.run
4
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/local.sh
5

    
6
if self_not_included; then
7

    
8
export archive="${BASH_SOURCE[0]%.run}"
9

    
10
export archive_filename="$(basename "$archive")"
11

    
12
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
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
export_ ()
37
{
38
	echo_func
39
	(cd "$top_dir"
40
	unzip_newer "$archive_filename" document.mwb.xml)
41
	export_mysql
42
	export_postgres
43
}
44

    
45
import ()
46
{
47
	echo_func
48
	(cd "$top_dir"
49
	zip_newer "$archive_filename" document.mwb.xml)
50
}
51

    
52
sync ()
53
{
54
	echo_func
55
	export_ "$@"
56
	import "$@"
57
}
58

    
59
all ()
60
{
61
	echo_func
62
	sync
63
}
64

    
65
fi
(3-3/13)