Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
tmp=()
2
 
3
fn fatal {
4
	if(! ~ $#tmp 0)
5
		rm -f $tmp
6
	echo $* >[1=2]
7
	exit $"*
8
}
9
 
10
fn must {
11
	$* || fatal $"*^': '^$status
12
}
13
 
14
fn need {
15
	for(i)
16
		if(~ $$i UNCONFIGURED)
17
			fatal $name^' does not set $'^$i
18
}
19
 
20
opt=()
21
while(! ~ $#* 0 && ~ $1 -*){
22
	if(~ $1 -s -c){	# take one argument 
23
		opt=($opt $1)
24
		shift
25
	}
26
	opt=($opt $1)
27
	shift
28
}
29
if(~ $1 --)
30
	shift
31
if(~ $#* 0)
32
	usage
33
name=$1
34
shift
35
paths=($*)
36
 
37
if(! ~ $name /* ./* ../*)
38
	name=$home/lib/replica/$name
39
 
40
if(! test -x $name)
41
	fatal no such replica $name
42
 
43
cfgopt=()
44
applyopt=()
45
fn servermount { status='' }
46
fn clientmount { status='' }
47
fn serverupdate { status='' }
48
for (i in clientroot clientproto clientdb clientexclude serverroot serverlog serverproto)
49
	$i=UNCONFIGURED
50
. $name
51
 
52
if(! ~ $#serverexclude 0)
53
	serverexclude=-x^$serverexclude
54
if(! ~ $#clientexclude 0)
55
	clientexclude=-x^$clientexclude