]> OCCT Git - occt-wok.git/commitdiff
Initial revision
authorcas <cas@opencascade.com>
Fri, 27 Sep 2002 18:04:22 +0000 (18:04 +0000)
committercas <cas@opencascade.com>
Fri, 27 Sep 2002 18:04:22 +0000 (18:04 +0000)
src/WOKStep/WOKStep_LibRename.tcl [new file with mode: 0755]

diff --git a/src/WOKStep/WOKStep_LibRename.tcl b/src/WOKStep/WOKStep_LibRename.tcl
new file mode 100755 (executable)
index 0000000..24fc7b5
--- /dev/null
@@ -0,0 +1,42 @@
+proc WOKStep_LibRename:AdmFileType {} {
+    return dbadmfile;
+}
+
+proc WOKStep_LibRename:OutputDirTypeName {} {
+    return dbtmpdir;
+}
+
+proc WOKStep_LibRename:HandleInputFile { ID } {
+ scan $ID "%\[^:\]:%\[^:\]:%\[^:\]"  unit type name
+    
+ if { [file extension $name] == ".so" } {
+
+  return 1;
+
+ } 
+
+ return 0;
+
+}
+
+
+proc  WOKStep_LibRename:Execute { theunit args } {    
+    foreach ID $args {
+       
+       scan $ID "%\[^:\]:%\[^:\]:%\[^:\]"  unit type name
+
+       set rootname [file rootname $name]
+       set ext [file extension $name]
+
+       if {  [regsub -all {\.} $rootname {_} newname] > 0 } {
+           msgprint -i -c "WOKStep_JavaCompile:Execute" "renaming $rootname to $newname$ext"
+           set libname [woklocate -p $ID]
+           #file rename -force $libname [file dirname $libname]/$newname$ext
+           if [catch {exec mv -f $libname [file dirname $libname]/$newname$ext } status ] {
+               msgprint -e -c "WOKStep_LibRename:Execute" $status      
+               return 1
+           }
+       }
+    }
+    return 0;
+}