root/lang/gauche/oldtype/trunk/bin/convert_all.sh @ 7811

Revision 7811, 1.4 kB (checked in by kiyoka, 6 years ago)

Added all project files of OldType?. (ported from sourceforge.jp)

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3#load configuration
4. ${OT_HOME}/config.sh
5. ${OT_HOME}/bin/lib.sh
6
7_oldtype_to() {
8    t=$1
9    src=$2
10    dst=$3
11    log=$4
12    ann=$5
13    ${OT_HOME}/src/oldtype_to ${t} ${src} ${log} ${ann} > ../_out/${base}.sexp.tmp
14
15    if [ "$?" = "0" ] ; then
16        /bin/mv -f ../_out/${base}.sexp.tmp ../_out/${base}.sexp
17    else
18        exit $?
19    fi
20}
21
22pushd . >& /dev/null
23
24cd        ${OT_EDITHOME}
25# update
26_svn t update
27
28cd        ${OT_EDITHOME}/edit/
29mkdir -p  ${OT_EDITHOME}/_out
30mkdir -p  ${OT_EDITHOME}/_tmp
31
32
33/bin/ls -1 *.ot > ../_tmp/all.list
34_svn t ls > ../_tmp/svn.list
35
36filelist=`cat ../_tmp/all.list ../_tmp/svn.list | sort | uniq -d`
37locallist=`cat ../_tmp/all.list ../_tmp/svn.list | sort | uniq -u`
38_svn t log --xml "..@HEAD" > ../_tmp/tmp.log
39
40for f in $locallist;
41do
42  base=`basename ${f} .ot`
43  echo "[" ${base} "]"
44  _oldtype_to internal "${base}.ot" ../_out/${base}.sexp
45done
46
47for f in $filelist;
48do
49  base=`basename ${f} .ot`
50  if [ "${base}.ot" -nt ../_out/${base}.sexp ] ; then
51      echo "[" ${base} "]"
52      _svn t ann "${f}@HEAD" > ../_tmp/tmp.ann
53      if [ "$?" != "0" ] ; then
54          msg="Warning: [ ${f} ] svn ann  command failed..."
55          echo ${msg}
56          logger "OldType: ${msg}"
57      fi
58      _oldtype_to internal "${base}.ot" ../_out/${base}.sexp     ../_tmp/tmp.log ../_tmp/tmp.ann
59  fi
60done
61
62# commit
63
64if [ "${OT_MASTER}" = "t" ] ; then
65    _svn t commit -m backend_process
66fi
67
68popd
Note: See TracBrowser for help on using the browser.