File: import2.sh

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (67 lines) | stat: -rwxr-xr-x 1,311 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#! /bin/sh
#
# Recense new resources on the neighbor class.
#
# Output line: resource_type resource_name type
# type=1: new type=2: exist but different

mdir=`pwd`

nei=$w_wims_home/log/classes/$w_nei
cd $w_wims_home/log/classes/$w_wims_class
cldir=`pwd`
cd $nei
ndir=`pwd`
cd $cldir

if [ $w_itype = motd ]; then
 cp $nei/.motd .
 echo success
 exit
fi

if [ $w_itype = exo ]; then
 mkdir -p src def
 cp $nei/src/$w_iname src
 exoroot=`echo $w_iname | sed 's/\.oef$//'`
 if [ -d $nei/src/images/$exoroot ]; then
  mkdir -p src/images
  cp -R $nei/src/images/$exoroot src/images
 fi
 cd $cldir
 msg=`src2def oef`
 echo success
 echo "$msg"
 exit
fi

if [ $w_itype = sheet ]; then
 cp $nei/sheets/.sheet$w_iname sheets/.sheet$w_replace
 if [ -e $nei/sheets/sheet$w_iname.src ]; then
   cp $nei/sheets/sheet$w_iname.def sheets/sheet$w_replace.def;
   cp $nei/sheets/sheet$w_iname.src sheets/sheet$w_replace.src;
 fi
 echo success
 exit
fi

if [ $w_itype = exam ]; then
 cp $nei/exams/.exam$w_iname exams/.exam$w_replace
 echo success
 exit
fi

if [ $w_itype = glossary ]; then
 cp $nei/tool/.glossary$w_iname tool/.glossary$w_replace
 echo success
 exit
fi

if [ $w_itype = doc ]; then
 rm -fR doc/c$w_replace 2>/dev/null
 mkdir -p doc >/dev/null
 cp -R $nei/doc/c$w_iname doc/c$w_replace
 echo success
 exit
fi