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 9854 aaronmk
.rel ../../lib/sh/archives.sh
5
.rel ../../lib/sh/local.sh
6
.rel ../../lib/sh/make.sh
7 8654 aaronmk
8 8705 aaronmk
if self_not_included; then
9
10 9074 aaronmk
VegCore.my.sql/make()
11 8926 aaronmk
{
12
	echo_func; set_make_vars
13 8941 aaronmk
	database=VegCore mysqldump_local --skip-add-drop-table >"$target"
14 8926 aaronmk
}
15
16 9074 aaronmk
export_mysql()
17 8926 aaronmk
{
18
	echo_func
19
	VegCore.my.sql/make
20
}
21
22 9074 aaronmk
VegCore.pg.sql/make()
23 8931 aaronmk
{
24
	echo_func; set_make_vars
25 8944 aaronmk
	sql_ascii=1 my2pg <"${target%.pg.sql}.my.sql" >"$target"
26 8931 aaronmk
}
27
28 9074 aaronmk
export_postgres()
29 8931 aaronmk
{
30
	echo_func
31
	VegCore.pg.sql/make
32
}
33
34 9074 aaronmk
export_()
35 8654 aaronmk
{
36 8881 aaronmk
	echo_func
37 8935 aaronmk
	(cd "$top_dir"; unzip_newer "$top_filename" document.mwb.xml)
38 8926 aaronmk
	export_mysql
39 8931 aaronmk
	export_postgres
40 8654 aaronmk
}
41
42 9074 aaronmk
import()
43 8654 aaronmk
{
44 8881 aaronmk
	echo_func
45 8935 aaronmk
	(cd "$top_dir"; zip_newer "$top_filename" document.mwb.xml)
46 8654 aaronmk
}
47
48 9074 aaronmk
sync()
49 8654 aaronmk
{
50 8881 aaronmk
	echo_func
51 8936 aaronmk
	export_
52
	import
53 8654 aaronmk
}
54
55 9074 aaronmk
all()
56 8654 aaronmk
{
57 8881 aaronmk
	echo_func
58 8654 aaronmk
	sync
59
}
60 8705 aaronmk
61
fi