aboutsummaryrefslogtreecommitdiff
path: root/sci/mathematics/scilab/scilab-4.1.2.diff
blob: f945fe12994c33e643c2f4492bfe397e5590d6cb (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
diff -Naur scilab-4.1.2/bin/scilink scilab-4.1.2.new/bin/scilink
--- scilab-4.1.2/bin/scilink	2001-04-26 03:43:33.000000000 -0400
+++ scilab-4.1.2.new/bin/scilink	2008-11-07 08:57:27.000000000 -0500
@@ -15,30 +15,31 @@
 shift
 LOCALPOS=`pwd`
 cd $SCI
-make show | grep -v make > /tmp/SciLink$$1
-sed -e "s+routines/default+\$SD+g"  -e "s+libs+\$SL+g" -e "s+./pvm3+\$SPVM+g" /tmp/SciLink$$1 > /tmp/SciLink$$2
+TMPWRKDIR=`mktemp -d sci.XXXXXXXXXX`
+make show | grep -v make > $TMPWRKDIR/SciLink$$1
+sed -e "s+routines/default+\$SD+g"  -e "s+libs+\$SL+g" -e "s+./pvm3+\$SPVM+g" $TMPWRKDIR/SciLink$$1 > $TMPWRKDIR/SciLink$$2
 for i in $*
 do
   x=`basename $i`
-  sed "s+\$SD/$x++g" /tmp/SciLink$$2 > /tmp/SciLink$$3
-  rm -f /tmp/SciLink$$2
-  mv /tmp/SciLink$$3 /tmp/SciLink$$2
+  sed "s+\$SD/$x++g" $TMPWRKDIR/SciLink$$2 > $TMPWRKDIR/SciLink$$3
+  rm -f $TMPWRKDIR/SciLink$$2
+  mv $TMPWRKDIR/SciLink$$3 $TMPWRKDIR/SciLink$$2
 done
-echo "#!/bin/sh" > /tmp/SciLink$$3
-echo  SCI=$SCI >>  /tmp/SciLink$$3
-echo "SD=\$SCI/routines/default" >>  /tmp/SciLink$$3
-echo "SPVM=\$SCI/pvm3" >>  /tmp/SciLink$$3
-echo "SL=\$SCI/libs" >>  /tmp/SciLink$$3
-echo "LOCAL=\"$*\"" >>  /tmp/SciLink$$3
-sed -e "s+\$SL+ \$LOCAL \$SL+" -e "s+show+scilex+g" /tmp/SciLink$$2 >> /tmp/SciLink$$3
+echo "#!/bin/sh" > $TMPWRKDIR/SciLink$$3
+echo  SCI=$SCI >>  $TMPWRKDIR/SciLink$$3
+echo "SD=\$SCI/routines/default" >>  $TMPWRKDIR/SciLink$$3
+echo "SPVM=\$SCI/pvm3" >>  $TMPWRKDIR/SciLink$$3
+echo "SL=\$SCI/libs" >>  $TMPWRKDIR/SciLink$$3
+echo "LOCAL=\"$*\"" >>  $TMPWRKDIR/SciLink$$3
+sed -e "s+\$SL+ \$LOCAL \$SL+" -e "s+show+scilex+g" $TMPWRKDIR/SciLink$$2 >> $TMPWRKDIR/SciLink$$3
 cd $LOCALPOS
-mv /tmp/SciLink$$3 Script
+mv $TMPWRKDIR/SciLink$$3 Script
 chmod +x Script 
 echo "Linking a new Scilab with " $*
 ./Script 
 echo "I've created : scilex and scilab which uses that scilex"
 sed -e "s+\$SCI/bin/scilex+`pwd`/scilex+g" $SCI/bin/scilab > scilab 
 chmod +x scilab 
-#rm -f /tmp/SciLink*
+#rm -f $TMPWRKDIR/SciLink*
 
 
diff -Naur scilab-4.1.2/util/scidem scilab-4.1.2.new/util/scidem
--- scilab-4.1.2/util/scidem	2002-09-02 07:14:52.000000000 -0400
+++ scilab-4.1.2.new/util/scidem	2008-11-07 08:57:27.000000000 -0500
@@ -6,33 +6,34 @@
 echo ------------------- File $2--------------------
 SCI1=$1
 if [ -f $3  ]; then rm $3;fi;
-trap "rm -f /tmp/$2.$$ /tmp/$2.$$.res /tmp/$2.$$.err /tmp/$2.$$.diff\
+TMPWRKDIR=`mktemp -d sci.XXXXXXXXXX`
+trap "rm -f $TMPWRKDIR/$2.$$ $TMPWRKDIR/$2.$$.res $TMPWRKDIR/$2.$$.err $TMPWRKDIR/$2.$$.diff\
         ;exit 1"  1 2 13 15
 echo "clear;lines(0);deff('[]=bugmes()','write(%io(2),''error on test'')');\
-        diary('$3');driver('Pos');" >> /tmp/$2.$$ ;
+        diary('$3');driver('Pos');" >> $TMPWRKDIR/$2.$$ ;
 sed     -e "s/pause,end/bugmes();quit;end/" \
         -e "s/halt()//" \
-        $2 >> /tmp/$2.$$ ;
-echo "diary(0);xend();exit;" >> /tmp/$2.$$ ;
-($SCI1/bin/scilab -nwni < /tmp/$2.$$ > /tmp/$2.$$.res ) 2> /tmp/$2.$$.err ;
+        $2 >> $TMPWRKDIR/$2.$$ ;
+echo "diary(0);xend();exit;" >> $TMPWRKDIR/$2.$$ ;
+($SCI1/bin/scilab -nwni < $TMPWRKDIR/$2.$$ > $TMPWRKDIR/$2.$$.res ) 2> $TMPWRKDIR/$2.$$.err ;
 sed -e "s/ \./0\./g" -e "s/E+/D+/g" -e "s/E-/D-/g" -e "s/-\./-0\./g" -e "s/^-->//g" -e "s/^-1->//g" $3 > $3.n
 grep -v "xinit(" $3.n | grep -v "diary(" | grep -v "exec("  > $3
 rm -f $3.n
-if ( grep " error" /tmp/$2.$$.res >  /dev/null ) ; then 
+if ( grep " error" $TMPWRKDIR/$2.$$.res >  /dev/null ) ; then 
         if [ $# != 4 ]; then 
                 echo "Test failed ERROR DETECTED  while executing $2" ;
-        else if (grep "$4" /tmp/$2.$$.res >  /dev/null ) ; 
+        else if (grep "$4" $TMPWRKDIR/$2.$$.res >  /dev/null ) ; 
              then  echo Test skipped ;
              else echo "Test failed ERROR DETECTED  while executing $2" ;
              fi;
         fi;
 else if [ -f $3.ref ];then 
-        if ( diff -w $3 $3.ref > /tmp/$2.$$.diff ) ;
+        if ( diff -w $3 $3.ref > $TMPWRKDIR/$2.$$.diff ) ;
         then  echo Test passed ;
         else  echo Test Failed SEE : diff -w  $3 $3.ref ;
         fi;
       fi;
 fi;
 echo ---------------------------------------------------------- 
-#rm -f /tmp/$2.$$ /tmp/$2.$$.res /tmp/$2.$$.err /tmp/$2.$$.diff
+#rm -f $TMPWRKDIR/$2.$$ $TMPWRKDIR/$2.$$.res $TMPWRKDIR/$2.$$.err $TMPWRKDIR/$2.$$.diff
 exit 0
diff -Naur scilab-4.1.2/util/scidoc scilab-4.1.2.new/util/scidoc
--- scilab-4.1.2/util/scidoc	2006-01-04 09:40:34.000000000 -0500
+++ scilab-4.1.2.new/util/scidoc	2008-11-07 08:57:27.000000000 -0500
@@ -7,24 +7,26 @@
 SCI=$1
 export SCI
 if [ -f $3  ]; then rm $3;fi;
-trap "rm -f /tmp/$2.$$ /tmp/$2.$$.res /tmp/$2.$$.err /tmp/$2.$$.diff\
+TMPWRKDIR=`mktemp -d sci.XXXXXXXXXX`
+trap "rm -f $TMPWRKDIR/$2.$$ $TMPWRKDIR/$2.$$.res $TMPWRKDIR/$2.$$.err $TMPWRKDIR/$2.$$.diff\
 	;exit 1"  1 2 13 15
 echo "clear;lines(0);deff('[]=bugmes()','write(%io(2),''error on test'')');\
-	diary('$3');driver('Pos');" >> /tmp/$2.$$ ;
+	diary('$3');driver('Pos');" >> $TMPWRKDIR/$2.$$ ;
 sed     -e "s/pause,end/bugmes();quit;end/" \
 	-e "s/halt()//" \
-        $2 >> /tmp/$2.$$ ;
-echo "diary(0);xend();quit;quit;quit;quit;quit;quit;" >> /tmp/$2.$$ ;
-($SCI/bin/scilex -nw < /tmp/$2.$$ > /tmp/$2.$$.res ) 2> /tmp/$2.$$.err ;
+        $2 >> $TMPWRKDIR/$2.$$ ;
+echo "diary(0);xend();quit;quit;quit;quit;quit;quit;" >> $TMPWRKDIR/$2.$$ ;
+($SCI/bin/scilex -nw < $TMPWRKDIR/$2.$$ > $TMPWRKDIR/$2.$$.res ) 2> $TMPWRKDIR/$2.$$.err ;
 sed -e "s/ \.[0-9]/0&/g" -e "s/0 \./0./g" -e "s/E+/D+/g" -e "s/E-/D-/g" -e "s/-\./-0\./g" $3 > $3.n
 grep -v "xinit(" $3.n | grep -v "diary(" | grep -v "exec("  > $3
 rm -f $3.n
-if ( grep error /tmp/$2.$$.res >  /dev/null ) ; then 
+if ( grep error $TMPWRKDIR/$2.$$.res >  /dev/null ) ; then 
 	if [ $# != 4 ]; then 
 		echo "ERROR DETECTED  while executing $2" ;
 	fi;
 fi;
 echo ---------------------------------------------------------- 
-rm -f /tmp/$2.$$ /tmp/$2.$$.res /tmp/$2.$$.err /tmp/$2.$$.diff
+rm -f $TMPWRKDIR/$2.$$ $TMPWRKDIR/$2.$$.res $TMPWRKDIR/$2.$$.err $TMPWRKDIR/$2.$$.diff 
+rmdir $TMPWRKDIR
 exit 0