root/lang/gauche/oldtype/branches/stable/bin/convert.sh @ 13289

Revision 13289, 1.3 kB (checked in by kiyoka, 7 years ago)

Released 0.2.4

  • 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}/edit/
25mkdir -p  ${OT_EDITHOME}/_out
26mkdir -p  ${OT_EDITHOME}/_tmp
27
28# copy images
29mkdir -p  ${OT_STATICHOME}/img
30/bin/cp -f ${OT_EDITHOME}/img/* ${OT_STATICHOME}/img
31
32/bin/ls -1 *.ot > ../_tmp/all.list
33_svn t ls > ../_tmp/svn.list
34
35filelist=`cat ../_tmp/all.list ../_tmp/svn.list | sort | uniq -d`
36locallist=`cat ../_tmp/all.list ../_tmp/svn.list | sort | uniq -u`
37_svn t log --xml "..@HEAD" > ../_tmp/tmp.log
38
39for f in $locallist;
40do
41  base=`basename ${f} .ot`
42  echo "[" ${base} "]"
43  _oldtype_to internal "${base}.ot" ../_out/${base}.sexp
44done
45
46for f in $filelist;
47do
48  base=`basename ${f} .ot`
49  if [ "${base}.ot" -nt ../_out/${base}.sexp ] ; then
50      echo "[" ${base} "]"
51      _svn t ann "${f}@HEAD" > ../_tmp/tmp.ann
52      if [ "$?" != "0" ] ; then
53          msg="Warning: [ ${f} ] svn ann  command failed..."
54          echo ${msg}
55          logger "OldType: ${msg}"
56      fi
57      _oldtype_to internal "${base}.ot" ../_out/${base}.sexp     ../_tmp/tmp.log ../_tmp/tmp.ann
58  fi
59done
60
61popd
Note: See TracBrowser for help on using the browser.