973c2be1 |
1 | # Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | # |
973c2be1 |
3 | # This file is part of Open CASCADE Technology software library. |
b311480e |
4 | # |
d5f74e42 |
5 | # This library is free software; you can redistribute it and/or modify it under |
6 | # the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | # by the Free Software Foundation, with special exception defined in the file |
8 | # OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | # distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | # |
973c2be1 |
11 | # Alternatively, this file may be used under the terms of Open CASCADE |
12 | # commercial license or contractual agreement. |
7fd59977 |
13 | |
14 | proc Draw_Replace:AdmFileType {} { |
15 | return "dbadmfile"; |
16 | } |
17 | |
18 | proc Draw_Replace:OutputDirTypeName {} { |
19 | return "dbtmpfile"; |
20 | } |
21 | |
22 | |
23 | proc Draw_Replace:HandleInputFile { ID } { |
24 | |
25 | scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name |
26 | |
27 | switch $name { |
28 | Draw_Interpretor.hxx {return 1;} |
29 | default { |
30 | return 0; |
31 | } |
32 | } |
33 | } |
34 | |
35 | proc Draw_Replace:Execute { unit args } { |
36 | |
37 | global tcl_interactive |
38 | |
39 | set tcl_interactive 1 |
40 | package require Wokutils |
41 | |
42 | msgprint -i -c "Draw_Replace:Execute" "Copying of Draw includes" |
43 | |
44 | if { [wokparam -e %Station $unit] != "wnt" } { |
45 | set copycmd "cp -p " |
46 | set replstr "/" |
47 | } { |
48 | set copycmd "cmd /c copy" |
49 | set replstr "\\\\\\\\" |
50 | } |
51 | |
52 | foreach file $args { |
53 | scan $file "%\[^:\]:%\[^:\]:%\[^:\]" Unit type name |
54 | |
55 | regsub ".hxx" $name "_proto.hxx" sourcename |
56 | |
57 | set source [woklocate -p Draw:source:$sourcename [wokinfo -N $unit]] |
58 | set vistarget [woklocate -p Draw:pubinclude:$name [wokinfo -N $unit]] |
59 | set target [wokinfo -p pubinclude:$name $unit] |
60 | |
61 | regsub -all "/" " $source $target" $replstr TheArgs |
62 | |
63 | msgprint -i -c "Draw_Replace:Execute" "Copy $source to $target" |
64 | if { [file exist $target] && [wokparam -e %Station] != "wnt" } { |
65 | eval exec "chmod u+w $target" |
66 | } |
67 | eval exec "$copycmd $TheArgs" |
68 | |
69 | } |
70 | return 0; |
71 | } |