s4

changeset 965:b6d1384e1b2c

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 759070ee3d20
children 679f621de4b5
files s4-funcs.sh s4-newworld.sh s4-world.sh
diffstat 3 files changed, 11 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/s4-funcs.sh	Sun Feb 20 08:47:31 2022 +0900
     1.2 +++ b/s4-funcs.sh	Sun Feb 20 15:37:50 2022 +0900
     1.3 @@ -33,7 +33,7 @@
     1.4  querylog=${QUERYLOG:-$logdir/query.log}
     1.5  searchlog=${SEARCHLOG:-$logdir/search.log}
     1.6  defaultdb=$dbdir/cgi.sq3
     1.7 -db=${DB:-$defaultdb}
     1.8 +db=${S4INITDB:-${DB:-$defaultdb}}
     1.9  sessdb=${SESSDB:-$dbdir/sess.sq3}
    1.10  userupdateflag=$dbdir/userupdate
    1.11  sesstb=tmp.sess
     2.1 --- a/s4-newworld.sh	Sun Feb 20 08:47:31 2022 +0900
     2.2 +++ b/s4-newworld.sh	Sun Feb 20 15:37:50 2022 +0900
     2.3 @@ -34,7 +34,7 @@
     2.4  echo "wl=$S4WORLDLIST"
     2.5  echo "$dispname:$shortname:$desc"
     2.6  # Create config
     2.7 -DB=db/$shortname.sq3; export DB
     2.8 +S4INITDB=db/$shortname.sq3; export S4INITDB
     2.9  `dirname $0`/s4-init.sh
    2.10  . `dirname $0`/s4-config.sh
    2.11  if ! type htmlescape >/dev/null 2>&1; then
    2.12 @@ -54,6 +54,7 @@
    2.13  
    2.14  masterdb=`(unset DB; . ./s4-config.sh; echo $DB)`
    2.15  S4MASTERDB=${masterdb:-db/cgi.sq3}
    2.16 +DB=$newdb; export DB
    2.17  echo Synching account: db=$db URL=$URL isCGI=$isCGI mas=$S4MASTERDB
    2.18  . ./s4-world.sh && syncaccount 'force'
    2.19  echo Synching done
    2.20 @@ -67,9 +68,8 @@
    2.21  	S4MASTERURL=\$URL
    2.22  	URL=`dirname ${URL}.`/s4-world-$shortname$cgiext
    2.23  	S4COLOR="$bgcolor"			# Change this!
    2.24 +	S4MASTERDB=\$DB				# \$DB always points to master
    2.25  	DB=$dbdir/$shortname.sq3
    2.26 -	SESSDB=$dbdir/sess.sq3
    2.27 -	S4MASTERDB=$S4MASTERDB
    2.28  	S4CSS=$shortname.css
    2.29  	TMPDIR=$tmpdir/$shortname
    2.30  EOF
     3.1 --- a/s4-world.sh	Sun Feb 20 08:47:31 2022 +0900
     3.2 +++ b/s4-world.sh	Sun Feb 20 15:37:50 2022 +0900
     3.3 @@ -80,7 +80,11 @@
     3.4    err "`gdate +%S.%3N` Starting account synchronization"
     3.5    SYNC_M=1
     3.6  
     3.7 -  prevsync=`tail -1 $syncflag|colrm 20`	# 2020-06-21 12:30:00 = 19cols
     3.8 +  if [ -s "$syncflag" ]; then
     3.9 +    prevsync=`tail -1 $syncflag|colrm 20`	# 2020-06-21 12:30:00 = 19cols
    3.10 +  else
    3.11 +    prevsync="2000-01-01 00:00:00"
    3.12 +  fi
    3.13    syncall=${db%.*}.syncall
    3.14    err syncallfile=$syncall
    3.15    if [ -e $syncall ]; then
    3.16 @@ -173,7 +177,8 @@
    3.17    runflag=${db%.*}.run
    3.18    userupdateflag=`dirname $S4MASTERDB`/`basename $userupdateflag`
    3.19    test ! -e "$userupdateflag"			&& return
    3.20 -  [ -z "$forceusersync" -a "$syncflag" -nt "$userupdateflag" ] && return
    3.21 +  [ -z "$forceusersync" -a -f "$syncflag" -a \
    3.22 +       "$syncflag" -nt "$userupdateflag" ] && return
    3.23    if [ -s "$runflag" ]; then
    3.24      limit=`cat $runflag|tr -c -d 0-9`
    3.25      err syncaccount: limit=$limit