File: catexisting.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 (33 lines) | stat: -rwxr-xr-x 1,037 bytes parent folder | download | duplicates (5)
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
#! /bin/sh
# We use shell script to output oef source file, because
# otherwise the $ sign will be substituted.

if [ -z "$w_catmodule" ]; then
 classd=$w_wims_home/log/classes/$w_wims_class
 oefname=$classd/src/$wims_exec_parm.oef
else
 moduled=modules/$w_catmodule
 test1=`grep -E '^[[:blank:]]*category[[:blank:]]*=.*oef' $moduled/INDEX`
 test2=`grep -E '^[[:blank:]]*copyright[[:blank:]]*=.*COPYING' $moduled/INDEX`
 if [ -z "$test1" ] || [ -z "$test2" ]; then
  rm -f $w_wims_home/$w_wims_sesdir/user-deposit 2>/dev/null
  exit
 fi
 oefname=$moduled/src/$wims_exec_parm.oef
fi
logd=$w_wims_home/log/classes/$w_wims_class/src/images
sesd=$w_wims_home/$w_wims_sesdir

if [ -f $oefname ]; then
 cat $oefname >$sesd/user-deposit
 cat $oefname >$sesd/submit.oef
 if [ -d $logd/$wims_exec_parm ]; then
  rm -fr $sesd/getfile/oefimg 2>/dev/null
  mkdir -p $sesd/getfile/oefimg 2>/dev/null
  cp -pPR $logd/$wims_exec_parm/* $sesd/getfile/oefimg 2>/dev/null
 fi
 echo yes
else
 rm -f $w_wims_home/$w_wims_sesdir/user-deposit 2>/dev/null
fi