annotate s4-world.sh @ 965:b6d1384e1b2c draft

s4-newworld fixed so that account sychronization done at the time
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 20 Feb 2022 15:37:50 +0900
parents 0352ff0fb37f
children 679f621de4b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
1 #!/bin/sh
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
2
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
3 autoremovestop=2
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
4
791
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
5 # Setup variables for running time
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
6 if $isCGI; then
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
7 case "$S4WORLDLIST" in
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
8 *:*:*)
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
9 worldlistfile=cache/worldlist
797
56adb6e5ee68 Add world-links to Grps entry of topmenu
HIROSE Yuuji <yuuji@gentei.org>
parents: 796
diff changeset
10 worldgrpfile=cache/worldgrps
791
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
11 worldoptionfile=cache/worldoption
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
12 worldnamefile=cache/worldname
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
13 if [ ! -e $worldlistfile -o $worldlistfile -ot s4-config.sh \
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
14 -o ! -e $worldoptionfile -o $worldoptionfile -ot s4-config.sh \
794
8448724f69e3 Account sync-ing and migration fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 791
diff changeset
15 -o s4-world.sh -nt $worldoptionfile ]
791
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
16 then
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
17 echo S4MASTERURL=$S4MASTERURL >> tmp/debug.out
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
18 cat <<-EOF > $worldlistfile
797
56adb6e5ee68 Add world-links to Grps entry of topmenu
HIROSE Yuuji <yuuji@gentei.org>
parents: 796
diff changeset
19 <div><table>
791
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
20 <tr><th>World List</th></tr>
794
8448724f69e3 Account sync-ing and migration fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 791
diff changeset
21 <tr><td title="Base World$nl拠点となるWorldです">&rArr;
8448724f69e3 Account sync-ing and migration fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 791
diff changeset
22 <a href="${S4MASTERURL:-$URL}">Base</a></td></tr>
791
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
23 EOF
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
24 true > $worldoptionfile
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
25 for i in $S4WORLDLIST; do
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
26 echo $i | {
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
27 IFS=: read name short d
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
28 cgi="s4-world-$short$cgiext"
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
29 conf="s4-config-$short.sh"
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
30 cat<<-EOF >>$worldlistfile
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
31 <tr><td title="$d">&rArr; <a href="$cgi">$name</a></td></tr>
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
32 EOF
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
33 cat<<-EOF >>$worldoptionfile
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
34 <option title="$d" value="$conf">$name</option>
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
35 EOF
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
36 echo "$name" > $worldnamefile.$short
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
37 }
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
38 done
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
39 if [ -s "$worldoptionfile" ]; then
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
40 echo "<option value=\"s4-config.sh\">Base</option>" >> $worldoptionfile
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
41 echo "</table>$nl</div>" >> $worldlistfile
797
56adb6e5ee68 Add world-links to Grps entry of topmenu
HIROSE Yuuji <yuuji@gentei.org>
parents: 796
diff changeset
42 sed 's/href="\([^>]*\)"/href="\1?grps"/' $worldlistfile \
56adb6e5ee68 Add world-links to Grps entry of topmenu
HIROSE Yuuji <yuuji@gentei.org>
parents: 796
diff changeset
43 > $worldgrpfile
791
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
44 else
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
45 true > $worldoptionfile; true > $worldlistfile # Remove contents
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
46 rm -f ${worldnamefile}.*
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
47 fi
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
48 fi
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
49 if [ -s "$worldlistfile" ]; then
797
56adb6e5ee68 Add world-links to Grps entry of topmenu
HIROSE Yuuji <yuuji@gentei.org>
parents: 796
diff changeset
50 S4WORLDS="▼spaste(\`$worldlistfile')"
791
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
51 S4WORLDNAME=${S4WORLD:+`cat $worldnamefile.$S4WORLD`}
797
56adb6e5ee68 Add world-links to Grps entry of topmenu
HIROSE Yuuji <yuuji@gentei.org>
parents: 796
diff changeset
52 S4WORLDGRPS="▼spaste(\`$worldgrpfile')"
791
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
53 fi
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
54 ;;
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
55 esac
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
56 fi
567980314463 World and Migration structures refined
HIROSE Yuuji <yuuji@gentei.org>
parents: 771
diff changeset
57
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
58
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
59 syncaccount_1() {
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
60
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
61 n_m=`query "SELECT printf('%d:%d',\
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
62 (SELECT count(*) FROM m.user), \
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
63 (SELECT count(*) FROM user));"`
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
64 n=${n_m%:*}; m=${n_m#*:} # n:m
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
65 if [ -z "$n" -o "$n" -lt 2 ]; then
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
66 err "Skipping account sync because m.user cannot be reached[n=$n]."
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
67 return -3
794
8448724f69e3 Account sync-ing and migration fixed
HIROSE Yuuji <yuuji@gentei.org>
parents: 791
diff changeset
68 fi
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
69 if [ -z "$forceusersync" -a ! -f db/forceusersync ]; then
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
70 if [ $((m-n)) -le $((autoremovestop+0)) ]; then
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
71 # If if-condition evaluation fails, fall through to else-caluse
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
72 rm -f db/forceusersync
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
73 else
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
74 err "More than $autoremovestop users vanished($((m-n)))."
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
75 err "Automatic removal canceled. If you want to sync user accounts"
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
76 err "forcibly, touch db/forceusersync file each time of world update."
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
77 return -4
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
78 fi
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
79 fi
885
4c02a9f862d7 Prefix process id in all log entries
HIROSE Yuuji <yuuji@gentei.org>
parents: 881
diff changeset
80 err "`gdate +%S.%3N` Starting account synchronization"
887
8229c75e9f94 Ensure user_s update
HIROSE Yuuji <yuuji@gentei.org>
parents: 885
diff changeset
81 SYNC_M=1
755
1a8291d7fa3d Annex strategy shifted to World strategy
HIROSE Yuuji <yuuji@gentei.org>
parents: 754
diff changeset
82
965
b6d1384e1b2c s4-newworld fixed so that account sychronization done at the time
HIROSE Yuuji <yuuji@gentei.org>
parents: 904
diff changeset
83 if [ -s "$syncflag" ]; then
b6d1384e1b2c s4-newworld fixed so that account sychronization done at the time
HIROSE Yuuji <yuuji@gentei.org>
parents: 904
diff changeset
84 prevsync=`tail -1 $syncflag|colrm 20` # 2020-06-21 12:30:00 = 19cols
b6d1384e1b2c s4-newworld fixed so that account sychronization done at the time
HIROSE Yuuji <yuuji@gentei.org>
parents: 904
diff changeset
85 else
b6d1384e1b2c s4-newworld fixed so that account sychronization done at the time
HIROSE Yuuji <yuuji@gentei.org>
parents: 904
diff changeset
86 prevsync="2000-01-01 00:00:00"
b6d1384e1b2c s4-newworld fixed so that account sychronization done at the time
HIROSE Yuuji <yuuji@gentei.org>
parents: 904
diff changeset
87 fi
835
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
88 syncall=${db%.*}.syncall
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
89 err syncallfile=$syncall
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
90 if [ -e $syncall ]; then
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
91 rm -f "$syncall"
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
92 err "Force update user_m for all users"
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
93 else
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
94 case "$prevsync" in
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
95 [2-9][0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]\ [012][0-9]:??:??)
881
a240c8988c65 Save profile update time stamp in user_s table
HIROSE Yuuji <yuuji@gentei.org>
parents: 880
diff changeset
96 SYNCCOND="WHERE name in (SELECT name FROM m.user_s WHERE key='profupdate' AND val > '$prevsync')"
880
fa5be649968f Omit update of user_m when no records in user_s modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 859
diff changeset
97 err "prevsync=$prevsync"
fa5be649968f Omit update of user_m when no records in user_s modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 859
diff changeset
98 limited=`query "SELECT DISTINCT name FROM m.user_s $SYNCCOND;"`
fa5be649968f Omit update of user_m when no records in user_s modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 859
diff changeset
99 if [ -n "$limited" ]; then
fa5be649968f Omit update of user_m when no records in user_s modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 859
diff changeset
100 err synccond limited to "$limited"
fa5be649968f Omit update of user_m when no records in user_s modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 859
diff changeset
101 else
fa5be649968f Omit update of user_m when no records in user_s modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 859
diff changeset
102 err synccond canceled for user_m
fa5be649968f Omit update of user_m when no records in user_s modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 859
diff changeset
103 SYNCCOND="WHERE NULL"
887
8229c75e9f94 Ensure user_s update
HIROSE Yuuji <yuuji@gentei.org>
parents: 885
diff changeset
104 SYNC_M=
880
fa5be649968f Omit update of user_m when no records in user_s modified
HIROSE Yuuji <yuuji@gentei.org>
parents: 859
diff changeset
105 fi
835
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
106 err "Touch $syncall (owner=`id -un`) to update all user_m."
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
107 ;;
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
108 *)
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
109 echo arere ;;
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
110 esac
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
111 fi
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
112 ## num=$(sqlite3 -bail -cmd 'PRAGMA FOREIGN_KEYS=on' $db <<EOF
903
d81dd0ed2d6d Add performance check logging.
HIROSE Yuuji <yuuji@gentei.org>
parents: 892
diff changeset
113 result=$(query <<EOF
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
114 BEGIN;
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
115 DElETE FROM main.user WHERE rowid NOT IN (SELECT rowid FROM m.user);
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
116 INSERT INTO main.user(rowid, name)
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
117 SELECT rowid, name FROM m.user
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
118 WHERE m.user.rowid NOT IN (SELECT rowid FROM user);
904
0352ff0fb37f Suppress user.name update for unchanged values, which takes a lot time.
HIROSE Yuuji <yuuji@gentei.org>
parents: 903
diff changeset
119 /* PrimaryKey:name cannot be changed, but ensure the integrity of user */
0352ff0fb37f Suppress user.name update for unchanged values, which takes a lot time.
HIROSE Yuuji <yuuji@gentei.org>
parents: 903
diff changeset
120 UPDATE user SET name = (SELECT name FROM m.user WHERE main.user.rowid=m.user.rowid) WHERE name != (SELECT name from m.user WHERE main.user.rowid=m.user.rowid);
755
1a8291d7fa3d Annex strategy shifted to World strategy
HIROSE Yuuji <yuuji@gentei.org>
parents: 754
diff changeset
121 DELETE FROM main.user_s WHERE rowid NOT IN (SELECT rowid FROM m.user_s);
1a8291d7fa3d Annex strategy shifted to World strategy
HIROSE Yuuji <yuuji@gentei.org>
parents: 754
diff changeset
122 REPLACE INTO main.user_s(rowid, name, key, type, val, bin)
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
123 SELECT rowid,* FROM m.user_s;
887
8229c75e9f94 Ensure user_s update
HIROSE Yuuji <yuuji@gentei.org>
parents: 885
diff changeset
124 ${SYNC_M:+
755
1a8291d7fa3d Annex strategy shifted to World strategy
HIROSE Yuuji <yuuji@gentei.org>
parents: 754
diff changeset
125 DELETE FROM main.user_m WHERE rowid NOT IN (SELECT rowid FROM m.user_m);
1a8291d7fa3d Annex strategy shifted to World strategy
HIROSE Yuuji <yuuji@gentei.org>
parents: 754
diff changeset
126 REPLACE INTO main.user_m(rowid, name, key, type, val, bin)
835
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
127 SELECT rowid,* FROM m.user_m $SYNCCOND
834
a87030974b99 Detect defference between src/dest table using EXCEPT.
HIROSE Yuuji <yuuji@gentei.org>
parents: 833
diff changeset
128 EXCEPT
835
fa23017ba273 Sync only latest entries in user_m
HIROSE Yuuji <yuuji@gentei.org>
parents: 834
diff changeset
129 SELECT rowid,* FROM main.user_m $SYNCCOND
887
8229c75e9f94 Ensure user_s update
HIROSE Yuuji <yuuji@gentei.org>
parents: 885
diff changeset
130 ;} /* SYNC_M closed here */
903
d81dd0ed2d6d Add performance check logging.
HIROSE Yuuji <yuuji@gentei.org>
parents: 892
diff changeset
131 SELECT 'OK';
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
132 END;
903
d81dd0ed2d6d Add performance check logging.
HIROSE Yuuji <yuuji@gentei.org>
parents: 892
diff changeset
133 EOF
d81dd0ed2d6d Add performance check logging.
HIROSE Yuuji <yuuji@gentei.org>
parents: 892
diff changeset
134 )
d81dd0ed2d6d Add performance check logging.
HIROSE Yuuji <yuuji@gentei.org>
parents: 892
diff changeset
135 err "`gdate +%S.%3N` Update account tables finished with result=[$result]"
d81dd0ed2d6d Add performance check logging.
HIROSE Yuuji <yuuji@gentei.org>
parents: 892
diff changeset
136 test x"$result" = x"OK" && num=$(query <<EOF
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
137 /* Compare user tables */
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
138 WITH master AS (
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
139 SELECT p.rowid,* FROM m.user p
887
8229c75e9f94 Ensure user_s update
HIROSE Yuuji <yuuji@gentei.org>
parents: 885
diff changeset
140 NATURAL LEFT JOIN m.user_s
8229c75e9f94 Ensure user_s update
HIROSE Yuuji <yuuji@gentei.org>
parents: 885
diff changeset
141 ${SYNC_M:+ NATURAL LEFT JOIN m.user_m}
903
d81dd0ed2d6d Add performance check logging.
HIROSE Yuuji <yuuji@gentei.org>
parents: 892
diff changeset
142 $SYNCCOND
756
a4523e15dfd6 s/annex/world/
HIROSE Yuuji <yuuji@gentei.org>
parents: 755
diff changeset
143 ), thisworld AS (
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
144 SELECT p.rowid,* FROM user p
887
8229c75e9f94 Ensure user_s update
HIROSE Yuuji <yuuji@gentei.org>
parents: 885
diff changeset
145 NATURAL LEFT JOIN user_s
8229c75e9f94 Ensure user_s update
HIROSE Yuuji <yuuji@gentei.org>
parents: 885
diff changeset
146 ${SYNC_M:+ NATURAL LEFT JOIN user_m}
903
d81dd0ed2d6d Add performance check logging.
HIROSE Yuuji <yuuji@gentei.org>
parents: 892
diff changeset
147 $SYNCCOND
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
148 ), m_a AS (
756
a4523e15dfd6 s/annex/world/
HIROSE Yuuji <yuuji@gentei.org>
parents: 755
diff changeset
149 SELECT * FROM master EXCEPT SELECT * FROM thisworld
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
150 ), a_m AS (
756
a4523e15dfd6 s/annex/world/
HIROSE Yuuji <yuuji@gentei.org>
parents: 755
diff changeset
151 SELECT * FROM thisworld EXCEPT SELECT * FROM master
752
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
152 ) SELECT (SELECT count(*) FROM m_a) + (SELECT count(*) FROM a_m);
c22e71dc8d9b Base of annex feature added
HIROSE Yuuji <yuuji@gentei.org>
parents:
diff changeset
153 EOF
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
154 )
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
155 if [ -n "$num" -a "$num" -eq 0 ]; then
885
4c02a9f862d7 Prefix process id in all log entries
HIROSE Yuuji <yuuji@gentei.org>
parents: 881
diff changeset
156 err "`gdate +%S.%3N` Account synchronization done in difference $num"
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
157 echo "`date '+%F %T'`: Sync done by process $$" >> $syncflag
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
158 else
885
4c02a9f862d7 Prefix process id in all log entries
HIROSE Yuuji <yuuji@gentei.org>
parents: 881
diff changeset
159 err "Account synch failed or bailed with num=[$num]"
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
160 fi
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
161 return $num
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
162 }
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
163
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
164 syncaccount() {
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
165 forceusersync=$1
859
ed9aae18fda9 Log format changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 835
diff changeset
166 ## err "db=$db mas=$S4MASTERDB sessdb=$sessdb"
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
167 # If in parent world, no need to do rest of jobs
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
168 if [ -z "$S4MASTERDB" -o ! -s "$S4MASTERDB" ]; then
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
169 return
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
170 fi
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
171 # Confim child
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
172 if [ "$db" -ef "$S4MASTERDB" ]; then
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
173 return # Points to the same file
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
174 fi
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
175 # File based sync check precedes to DB count check for performance issue
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
176 syncflag=${db%.*}.synctime
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
177 runflag=${db%.*}.run
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
178 userupdateflag=`dirname $S4MASTERDB`/`basename $userupdateflag`
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
179 test ! -e "$userupdateflag" && return
965
b6d1384e1b2c s4-newworld fixed so that account sychronization done at the time
HIROSE Yuuji <yuuji@gentei.org>
parents: 904
diff changeset
180 [ -z "$forceusersync" -a -f "$syncflag" -a \
b6d1384e1b2c s4-newworld fixed so that account sychronization done at the time
HIROSE Yuuji <yuuji@gentei.org>
parents: 904
diff changeset
181 "$syncflag" -nt "$userupdateflag" ] && return
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
182 if [ -s "$runflag" ]; then
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
183 limit=`cat $runflag|tr -c -d 0-9`
892
3c9c65ff80f0 Log more information
HIROSE Yuuji <yuuji@gentei.org>
parents: 887
diff changeset
184 err syncaccount: limit=$limit
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
185 if [ -n "$limit" -a "$limit" -gt `date +%s` ]; then
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
186 err "World $S4WORLD account sync withholded by process $$"
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
187 return # Running sync by other process not leaching timeout
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
188 fi
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
189 fi
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
190 echo $((`date +%s` + 10)) > $runflag # Setting running flag by timeout 10s
892
3c9c65ff80f0 Log more information
HIROSE Yuuji <yuuji@gentei.org>
parents: 887
diff changeset
191 err syncaccount: setrunflag[$runflag]=`cat $runflag`
817
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
192 query<<-EOF
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
193 .bail ON
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
194 ATTACH DATABASE "$S4MASTERDB" AS m;
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
195 EOF
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
196 syncaccount_1
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
197 rc=$?
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
198 test -e "$runflag" && rm -f "$runflag"
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
199 query<<-EOF
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
200 DETACH DATABASE m;
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
201 .bail OFF
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
202 EOF
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
203 return $rc
d2c4c473e08e Account synchronization more prudent
HIROSE Yuuji <yuuji@gentei.org>
parents: 811
diff changeset
204 }
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
205
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
206 getworldDB() { # $1=conf
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
207 (unset DB; . "$1"; echo ${DB:-$defaultdb})
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
208 }
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
209
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
210 worldnameDBlist() {
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
211 echo Base:Base:`getworldDB ./s4-config.sh`
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
212 for w in $S4WORLDLIST; do
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
213 case "$w" in
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
214 *:*:*:*) continue ;;
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
215 *:*:*) w=${w%:*}; name=${w%:*}; world=${w#*:} ;;
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
216 *) continue ;;
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
217 esac
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
218 d=`getworldDB "./s4-config-$world.sh"`
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
219 test -s "$d" && echo ${world}:${name}:$d
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
220 done
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
221 }
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
222
828
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
223 grepgrpworld() {
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
224 world=$1; wname=$2; exp=$3; tdb=$4
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
225 case $world in
827
97be0474f268 List belonging groups
HIROSE Yuuji <yuuji@gentei.org>
parents: 826
diff changeset
226 Base) cgi=${S4MASTERURL:-$URL} ;;
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
227 *) cgi=s4-world-$world$cgiext ;;
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
228 esac
827
97be0474f268 List belonging groups
HIROSE Yuuji <yuuji@gentei.org>
parents: 826
diff changeset
229 case $exp in
828
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
230 mem:*)
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
231 arg=${exp#*:}
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
232 cond="user = '$arg'"
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
233 guide="「${S4WORLDNAME:-Base}」以外の世界の所属グループ"
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
234 s="(<a href=\"$cgi?stage=grps&kwd=mem:$arg\">所属絞</a>)" ;;
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
235 *)
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
236 arg=`sqlquote "%$3%"`
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
237 cond="gname LIKE $arg"
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
238 guide="$exp を含むグループは別世界にもあります"
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
239 s="(<a href=\"$cgi?stage=grps&kwd=$exp\">絞込</a>)" ;;
827
97be0474f268 List belonging groups
HIROSE Yuuji <yuuji@gentei.org>
parents: 826
diff changeset
240 esac
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
241 query <<-EOF |
828
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
242 ATTACH DATABASE "$tdb" AS td;
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
243 SELECT DISTINCT td.grp.rowid,hex(gname)
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
244 FROM td.grp NATURAL JOIN td.grp_mem
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
245 WHERE $cond;
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
246 DETACH DATABASE td;
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
247 EOF
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
248 while IFS='|' read rowid hgname; do
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
249 # echo rowid=$rowid - `echo "$hgname"|unhexize|htmlescape`
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
250 htmlgn=`echo $hgname|unhexize|htmlescape`
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
251 printf '<a href="%s?grp+%d">%s</a> ' "$cgi" "$rowid" "$htmlgn"
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
252 done | {
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
253 read ans
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
254 if [ -n "$ans" ]; then
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
255 w=`echo $wname|htmlescape`
826
f2d69fb3e038 Link to group list in other world with kwd
HIROSE Yuuji <yuuji@gentei.org>
parents: 825
diff changeset
256 u="<a href=\"$cgi?grps\"><span class=\"pre\">$w</span></a>"
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
257 cat<<-EOF
828
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
258 GUIDE:<h2>`echo "$guide"|htmlescape`</h2>
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
259 <tr>
826
f2d69fb3e038 Link to group list in other world with kwd
HIROSE Yuuji <yuuji@gentei.org>
parents: 825
diff changeset
260 <tr><td>$u $s</td>
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
261 <td>$ans</td>
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
262 </dl>
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
263 EOF
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
264 fi
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
265 }
828
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
266 }
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
267
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
268 peekgrpworlds() (
828
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
269 # $1=(Pattern|mem:User)
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
270 # err "pgw-1=[$1]"
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
271 for wd in `worldnameDBlist`; do
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
272 world=${wd%%:*}; wd=${wd#*:}
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
273 worldname=${wd%:*}
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
274 d=${wd#*:}
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
275 if [ ! $db -ef $d -a -s $d ]; then
827
97be0474f268 List belonging groups
HIROSE Yuuji <yuuji@gentei.org>
parents: 826
diff changeset
276 grepgrpworld "$world" "$worldname" "$1" "$d"
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
277 fi
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
278 done | {
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
279 result=`cat`
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
280 if [ -n "$result" ]; then
828
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
281 cat<<-EOF
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
282 `echo "$result"|sed 's/^GUIDE://;2q'`
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
283 <table class="b">
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
284 `echo "$result"|grep -v '^GUIDE:'`
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
285 </table>
476a70f667cf Group search expression formula changed
HIROSE Yuuji <yuuji@gentei.org>
parents: 827
diff changeset
286 EOF
825
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
287 fi
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
288 }
e9817a71f332 List groups in other worlds
HIROSE Yuuji <yuuji@gentei.org>
parents: 820
diff changeset
289 )

yatex.org