Rev 12115 | Rev 12895 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 12115 | Rev 12555 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | as_t_sup=supervisor |
21 | as_t_sup=supervisor |
22 | as_t_seq=seq |
22 | as_t_seq=seq |
23 | as_t_userphoto=photoboard |
23 | as_t_userphoto=photoboard |
24 | as_list=doc,exo,sheet,exam,vote,cdt,livret,forum,user,motd,sup,livret,seq,userphoto |
24 | as_list=doc,exo,sheet,exam,vote,cdt,livret,forum,user,motd,sup,livret,seq,userphoto |
25 | !if sharing notwordof $wims_prefix |
25 | !if sharing notwordof $wims_prefix |
26 | wims_prefix=$wims_prefix n sharing sharable |
26 | wims_prefix=$wims_prefix n sharing sharable |
27 | !endif |
27 | !endif |
28 | 28 | ||
29 | !if all isitemof $as_l |
29 | !if all isitemof $as_l |
30 | as_l=$as_list |
30 | as_l=$as_list |
31 | !else |
31 | !else |
32 | !if exam isitemof $as_l |
32 | !if exam isitemof $as_l |
33 | as_l=!listunion $as_l and sheet |
33 | as_l=!listunion $as_l and sheet |
34 | !endif |
34 | !endif |
35 | !if sheet iswordof $as_l |
35 | !if sheet iswordof $as_l |
36 | as_l=!listunion $as_l and exo |
36 | as_l=!listunion $as_l and exo |
37 | !endif |
37 | !endif |
38 | !endif |
38 | !endif |
39 | 39 | ||
40 | L_= |
40 | L_= |
41 | !for t in $as_list |
41 | !for t in $as_list |
42 | !if $t isitemof $as_l |
42 | !if $t isitemof $as_l |
43 | L_=$L_ $(as_t_$t) |
43 | L_=$L_ $(as_t_$t) |
44 | !endif |
44 | !endif |
45 | !next t |
45 | !next t |
46 | !if $L_=$empty |
46 | !if $L_=$empty |
47 | !exit |
47 | !exit |
48 | !endif |
48 | !endif |
49 | as_n1=!defof n_sup\ |
49 | as_n1=!defof n_sup\ |
50 | n_part in wimshome/log/classes/$as_1/neighbors |
50 | n_part in wimshome/log/classes/$as_1/neighbors |
51 | as_n2=!defof n_sup\ |
51 | as_n2=!defof n_sup\ |
52 | n_part in wimshome/log/classes/$as_2/neighbors |
52 | n_part in wimshome/log/classes/$as_2/neighbors |
53 | !distribute lines $as_n1 into as_nsup1,as_npart1 |
53 | !distribute lines $as_n1 into as_nsup1,as_npart1 |
54 | !distribute lines $as_n2 into as_nsup2,as_npart2 |
54 | !distribute lines $as_n2 into as_nsup2,as_npart2 |
55 | as_test=!listcomplement user in $as_l |
55 | as_test=!listcomplement user in $as_l |
56 | !if ($as_test!=$empty and \ |
56 | !if ($as_test!=$empty and \ |
57 | ($as_2 notitemof $as_nsup1 or $as_1 notitemof $as_nsup2)) or \ |
57 | ($as_2 notitemof $as_nsup1 or $as_1 notitemof $as_nsup2)) or \ |
58 | (user isitemof $as_l and \ |
58 | (user isitemof $as_l and \ |
59 | ($as_2 notitemof $as_npart1 or $as_1 notitemof $as_npart2)) |
59 | ($as_2 notitemof $as_npart1 or $as_1 notitemof $as_npart2)) |
60 | error=addshare_noright |
60 | error=addshare_noright |
61 | !exit |
61 | !exit |
62 | !endif |
62 | !endif |
63 | 63 | ||
64 | 1_=!translate internal / to , in $as_1 |
64 | 1_=!translate internal / to , in $as_1 |
65 | 2_=!translate internal / to , in $as_2 |
65 | 2_=!translate internal / to , in $as_2 |
66 | 1=!itemcnt $1_ |
66 | 1=!itemcnt $1_ |
67 | 2=!itemcnt $2_ |
67 | 2=!itemcnt $2_ |
68 | 3=$[min($1,$2)] |
68 | 3=$[min($1,$2)] |
69 | 69 | ||
70 | !for i=1 to $3+1 |
70 | !for i=1 to $3+1 |
71 | !if $(1_[$i]) != $(2_[$i]) |
71 | !if $(1_[$i]) != $(2_[$i]) |
72 | !break |
72 | !break |
73 | !endif |
73 | !endif |
74 | !next i |
74 | !next i |
75 | 75 | ||
76 | 1_=!item $i to -1 of $1_ |
76 | 1_=!item $i to -1 of $1_ |
77 | !if $i<=$2 |
77 | !if $i<=$2 |
78 | 4_=!makelist .. for x=$i to $2 |
78 | 4_=!makelist .. for x=$i to $2 |
79 | 1_=$4_,$1_ |
79 | 1_=$4_,$1_ |
80 | !endif |
80 | !endif |
81 | 1_=!nonempty items $1_ |
81 | 1_=!nonempty items $1_ |
82 | 1_=!nospace $1_ |
82 | 1_=!nospace $1_ |
83 | 1_=!translate internal , to / in $1_ |
83 | 1_=!translate internal , to / in $1_ |
84 | 84 | ||
85 | !for t in $as_list |
85 | !for t in $as_list |
86 | !reset sharing_$t |
86 | !reset sharing_$t |
87 | !next t |
87 | !next t |
88 | !readdef wimshome/log/classes/$as_1/neighbors |
88 | !readdef wimshome/log/classes/$as_1/neighbors |
89 | !for t in $as_l |
89 | !for t in $as_l |
90 | !if $(sharing_$t) != $empty |
90 | !if $(sharing_$t) != $empty |
91 | error=addshare_conflict |
91 | error=addshare_conflict |
92 | !exit |
92 | !exit |
93 | !endif |
93 | !endif |
94 | !next t |
94 | !next t |
95 | !for t in $as_list |
95 | !for t in $as_list |
96 | !reset sharable_$t |
96 | !reset sharable_$t |
97 | !next t |
97 | !next t |
98 | !readdef wimshome/log/classes/$as_2/neighbors |
98 | !readdef wimshome/log/classes/$as_2/neighbors |
99 | as_already= |
99 | as_already= |
100 | !for t in $as_l |
100 | !for t in $as_l |
101 | !if $(sharable_$t) != $empty |
101 | !if $(sharable_$t) != $empty |
102 | error=addshare_conflict |
102 | error=addshare_conflict |
103 | !exit |
103 | !exit |
104 | !endif |
104 | !endif |
105 | !if $(sharing_$t) != $empty |
105 | !if $(sharing_$t) != $empty |
106 | !if $(sharing_$t) = $as_1 |
106 | !if $(sharing_$t) = $as_1 |
107 | as_already=!append item $t to $as_already |
107 | as_already=!append item $t to $as_already |
108 | !else |
108 | !else |
109 | error=addshare_conflict |
109 | error=addshare_conflict |
110 | !exit |
110 | !exit |
- | 111 | !endif |
|
111 | !endif |
112 | !endif |
112 | !endif |
- | |
113 | !next t |
113 | !next t |
114 | !if $as_already!=$empty |
114 | !if $as_already!=$empty |
115 | as_l=!listcomplement $as_already in $as_l |
115 | as_l=!listcomplement $as_already in $as_l |
116 | !endif |
116 | !endif |
117 | !for t in $as_list |
117 | !for t in $as_list |
118 | !reset sharable_$t |
118 | !reset sharable_$t |
119 | !next t |
119 | !next t |
120 | !readdef wimshome/log/classes/$as_1/neighbors |
120 | !readdef wimshome/log/classes/$as_1/neighbors |
121 | as_= |
121 | as_= |
122 | !for t in $as_l,all |
122 | !for t in $as_l,all |
123 | sharable_$t=!listunion $(sharable_$t) and $as_2 |
123 | sharable_$t=!listunion $(sharable_$t) and $as_2 |
124 | as_=$as_\ |
124 | as_=$as_\ |
125 | sharable_$t=$(sharable_$t) |
125 | sharable_$t=$(sharable_$t) |
126 | !next t |
126 | !next t |
127 | !setdef $as_ in wimshome/log/classes/$as_1/neighbors |
127 | !setdef $as_ in wimshome/log/classes/$as_1/neighbors |
128 | !for t in $as_list |
128 | !for t in $as_list |
129 | !reset sharing_$t |
129 | !reset sharing_$t |
130 | !next t |
130 | !next t |
131 | !readdef wimshome/log/classes/$as_2/neighbors |
131 | !readdef wimshome/log/classes/$as_2/neighbors |
132 | as_= |
132 | as_= |
133 | !for t in $as_l |
133 | !for t in $as_l |
134 | as_=$as_\ |
134 | as_=$as_\ |
135 | sharing_$t=$as_1 |
135 | sharing_$t=$as_1 |
136 | !next t |
136 | !next t |
137 | sharing_all=!listunion $sharing_all and $as_1 |
137 | sharing_all=!listunion $sharing_all and $as_1 |
138 | as_=$as_\ |
138 | as_=$as_\ |
139 | sharing_all=$sharing_all |
139 | sharing_all=$sharing_all |
140 | !setdef $as_ in wimshome/log/classes/$as_2/neighbors |
140 | !setdef $as_ in wimshome/log/classes/$as_2/neighbors |
141 | 141 | ||
142 | as_copy= |
142 | as_copy= |
143 | !if sheet isitemof $as_l |
143 | !if sheet isitemof $as_l |
144 | as_copy=$1_/.[0-9]* |
144 | as_copy=$1_/.[0-9]* |
145 | !endif |
145 | !endif |
146 | !if exam isitemof $as_l |
146 | !if exam isitemof $as_l |
147 | as_copy=$as_copy $1_/.E[0-9]* |
147 | as_copy=$as_copy $1_/.E[0-9]* |
148 | !endif |
148 | !endif |
149 | !if $as_copy!=$empty |
149 | !if $as_copy!=$empty |
150 | as_copy=cp -f $as_copy . 2>/dev/null |
150 | as_copy=cp -f $as_copy . 2>/dev/null |
151 | !endif |
151 | !endif |
152 | !if user isitemof $as_l |
152 | !if user isitemof $as_l |
153 | as_touch=touch $1_/.userlist_external |
153 | as_touch=touch $1_/.userlist_external |
154 | !endif |
154 | !endif |
155 | 155 | ||
Line 158... | Line 158... | ||
158 | $as_touch\ |
158 | $as_touch\ |
159 | for f in $L_; do\ |
159 | for f in $L_; do\ |
160 | ln -s $1_/$$f .\ |
160 | ln -s $1_/$$f .\ |
161 | done\ |
161 | done\ |
162 | $as_copy |
162 | $as_copy |
163 | - |