]> OCCT Git - occt-wok.git/commitdiff
Bug OCC4062 The filling of development version of WOK doesn't equivalent to release...
authorcascade <cascade@opencascade.com>
Fri, 5 Mar 2004 20:48:46 +0000 (20:48 +0000)
committercascade <cascade@opencascade.com>
Fri, 5 Mar 2004 20:48:46 +0000 (20:48 +0000)
src/WOKsite/CreateFactory.tcl
src/WOKsite/tclshrc_Wok
src/WOKsite/wok.csh

index 8192ec71c371ef85be0a1f368a91a8d79431750f..50d4f691e65b9b0aa9ac5777a0ddd6dba1fb2a2d 100755 (executable)
-;#\r
-;# This file is used to create from scratch a minimal set of WOK entities\r
-;# A Factory, a warehouse, a workshop and a workbench. It can be used to import\r
-;# sources files from a previously Cascade download.\r
-;# this script has 5 arguments:\r
-;# HOME_ENTITIES is a directory name. This is the name where all further entities\r
-;# will be created.\r
-;# FNAM is a factory name ( a factory is a set of workshop and a warehouse)\r
-;# WSNAM is a workshop name ( a workshop is dedicated to contains a workbenches tree)\r
-;# WBNAM is a workbench name. Typically it will be the name of the root workbench.\r
-;# IMPORT_DIR is a directory name. If IMPORT_DIR is /dev/null no import is done\r
-;# and WBNAM is created as empty workbench. To populate it with development units\r
-;# please refer to the Wok documentation.\r
-;#\r
-source $env(WOKHOME)/site/tclshrc_Wok\r
-proc FileToList { path {sort 0} {trim 0} {purge 0} {emptl 1} } {\r
-    if ![ catch { set id [ open $path r ] } ] {\r
-       set l  {}\r
-       while {[gets $id line] >= 0 } {\r
-           if { $trim } {\r
-               regsub -all {[ ]+} $line " " line\r
-           }\r
-           if { $emptl } {\r
-               if { [string length ${line}] != 0 } {\r
-                   lappend l $line\r
-               }\r
-           } else {\r
-               lappend l $line\r
-           }\r
-       }\r
-       close $id\r
-       if { $sort } {\r
-           return [lsort $l]\r
-       } else {\r
-           return $l\r
-       }\r
-    } else {\r
-       return {}\r
-    }\r
-}\r
-;#\r
-;#\r
-;#\r
-proc lreplace { fin fout ls1s2 } {\r
-    if { [catch { set in [ open $fin r ] } errin] == 0 } {\r
-       if { [catch { set out [ open $fout w ] } errout] == 0 } {\r
-           set strin [read $in [file size $fin]]\r
-           close $in\r
-           foreach [list s1 s2] $ls1s2 {\r
-               set done 0\r
-               if { [set nbsub [regsub -all -- $s1 $strin $s2 strout]] != 0 } {\r
-                   set done 1\r
-               }\r
-               set strin $strout\r
-           }\r
-           puts $out $strout\r
-           close $out\r
-           return $done\r
-       } else {\r
-           puts stderr "Error: $errout"\r
-           return 0\r
-       }\r
-    } else {\r
-       puts stderr "Error: $errin"\r
-       return 0\r
-    }\r
-}\r
-;#\r
-;#\r
-proc CreateFactory { HOME_ENTITIES FNAM WSNAM WBNAM IMPORT_DIR } {\r
-\r
-    package require Wok\r
-    package require Ms\r
-    global env\r
-    \r
-    if [catch { package require Tclx } TclXHere] {\r
-       puts stderr "Warning : You'll need package TclX to correctly use WOK."\r
-       puts stderr "          Check for variable TCLLIBPATH"\r
-    }\r
-    if [catch { package require Expect } ExpectHere] {\r
-       puts stderr "Warning : You'll need package Expect to use WOK integration package.."\r
-       puts stderr "          Check for variable TCLLIBPATH"\r
-    }\r
-    \r
-    ;#\r
-    set savpwd [pwd]\r
-    \r
-    ;#\r
-    ;# Create factory FNAM and warehouse attached to it\r
-    ;#\r
-    if { ![wokinfo -x ${FNAM}] } {\r
-       puts "Creating the factory : ${FNAM}"\r
-       if ![catch {fcreate -DHome=$HOME_ENTITIES/${FNAM} -d ${FNAM} } astatus ] {\r
-           wokcd ${FNAM}\r
-           if { ![wokinfo -x ${FNAM}:BAG] } {\r
-               puts "Creating the WareHouse in $HOME_ENTITIES/${FNAM}/BAG"\r
-               if [ catch {Wcreate -DHome=$HOME_ENTITIES/${FNAM}/BAG -d -DAdm=$HOME_ENTITIES/${FNAM}/BAG/adm BAG } astatus ] {\r
-                   puts $astatus\r
-                   cd $savpwd\r
-               }\r
-           }\r
-       } else {\r
-           puts $astatus\r
-           cd $savpwd\r
-       }\r
-    }\r
-    \r
-    ;#\r
-    ;# Create workshop WSNAM\r
-    ;#\r
-    if { ![wokinfo -x ${FNAM}:${WSNAM}] } {\r
-       puts "Creating the workshop : ${FNAM}:${WSNAM}"\r
-       if ![ catch {screate -DHome=$HOME_ENTITIES/${FNAM}/${WSNAM} -d ${WSNAM} } astatus] {\r
-           wokcd -PAdm ${FNAM}:${WSNAM}\r
-           catch { mkdir Repository }\r
-           lreplace $env(WOK_LIBRARY)/VC.example [pwd]/VC.edl [list /dev/null [pwd]/Repository SCCS NOBASE]\r
-           exec cp $env(WOK_LIBRARY)/VC.tcldef [pwd]/VC.tcl\r
-       } else {\r
-           puts $astatus\r
-           cd $savpwd\r
-       }\r
-    }\r
-    ;#\r
-    ;# Create workbench WBNAM \r
-    ;#\r
-    if { ![wokinfo -x ${FNAM}:${WSNAM}:${WBNAM}] } {\r
-       puts "Creating the workbench : ${FNAM}:${WSNAM}:${WBNAM}"\r
-       wokcd ${FNAM}:${WSNAM}\r
-       set WBROOT $HOME_ENTITIES/${FNAM}/${WSNAM}/${WBNAM}\r
-       #if { "$IMPORT_DIR" != {} } {\r
-           #set WBROOT [file join [file dirname $IMPORT_DIR] ${WBNAM}]\r
-           #puts "Renaming $IMPORT_DIR to $WBROOT"\r
-           #frename $IMPORT_DIR $WBROOT\r
-           #puts " the Home directory of your ${WBNAM} WorkBench is now : ${WBROOT}"\r
-       #}\r
-       if [ catch {wcreate -DHome=$IMPORT_DIR -d ${WBNAM} } astatus] {\r
-           puts $astatus\r
-           cd $savpwd\r
-           exit\r
-       }\r
-    }\r
-    \r
-    \r
-    if { "$IMPORT_DIR" != {} } {\r
-       wokcd -PAdm ${FNAM}:${WSNAM}:${WBNAM}\r
-       foreach udl [glob -nocomplain *.UDLIST] {\r
-           puts "Importing units from module $udl"\r
-           foreach unit [FileToList $udl] {\r
-               if [ catch { ucreate -[lindex $unit 0] [lindex $unit 1] } astatus] {\r
-                   puts $astatus\r
-               }\r
-           }\r
-       }\r
-    }\r
-    cd $savpwd\r
-}\r
-\r
-#set HOME_ENTITIES [lindex $argv 0]\r
-#set FNAM          [lindex $argv 1]\r
-#set WSNAM         [lindex $argv 2]\r
-#set WBNAM         [lindex $argv 3]\r
-#set IMPORT_DIR    [lindex $argv 4]\r
-set CASHOME [file dirname $env(CASROOT)/.]\r
-\r
-CreateFactory $env(WOK_ROOTADMDIR) OS OCC51 ros $CASHOME\r
-\r
-#exit\r
-\r
+;#
+;# This file is used to create from scratch a minimal set of WOK entities
+;# A Factory, a warehouse, a workshop and a workbench. It can be used to import
+;# sources files from a previously Cascade download.
+;# this script has 5 arguments:
+;# HOME_ENTITIES is a directory name. This is the name where all further entities
+;# will be created.
+;# FNAM is a factory name ( a factory is a set of workshop and a warehouse)
+;# WSNAM is a workshop name ( a workshop is dedicated to contains a workbenches tree)
+;# WBNAM is a workbench name. Typically it will be the name of the root workbench.
+;# IMPORT_DIR is a directory name. If IMPORT_DIR is /dev/null no import is done
+;# and WBNAM is created as empty workbench. To populate it with development units
+;# please refer to the Wok documentation.
+;#
+source $env(WOKHOME)/site/tclshrc_Wok
+proc FileToList { path {sort 0} {trim 0} {purge 0} {emptl 1} } {
+    if ![ catch { set id [ open $path r ] } ] {
+       set l  {}
+       while {[gets $id line] >= 0 } {
+           if { $trim } {
+               regsub -all {[ ]+} $line " " line
+           }
+           if { $emptl } {
+               if { [string length ${line}] != 0 } {
+                   lappend l $line
+               }
+           } else {
+               lappend l $line
+           }
+       }
+       close $id
+       if { $sort } {
+           return [lsort $l]
+       } else {
+           return $l
+       }
+    } else {
+       return {}
+    }
+}
+;#
+;#
+;#
+proc lreplace { fin fout ls1s2 } {
+    if { [catch { set in [ open $fin r ] } errin] == 0 } {
+       if { [catch { set out [ open $fout w ] } errout] == 0 } {
+           set strin [read $in [file size $fin]]
+           close $in
+           foreach [list s1 s2] $ls1s2 {
+               set done 0
+               if { [set nbsub [regsub -all -- $s1 $strin $s2 strout]] != 0 } {
+                   set done 1
+               }
+               set strin $strout
+           }
+           puts $out $strout
+           close $out
+           return $done
+       } else {
+           puts stderr "Error: $errout"
+           return 0
+       }
+    } else {
+       puts stderr "Error: $errin"
+       return 0
+    }
+}
+;#
+;#
+proc CreateFactory { HOME_ENTITIES FNAM WSNAM WBNAM IMPORT_DIR } {
+
+    package require Wok
+    package require Ms
+    global env
+    
+    if [catch { package require Tclx } TclXHere] {
+       puts stderr "Warning : You'll need package TclX to correctly use WOK."
+       puts stderr "          Check for variable TCLLIBPATH"
+    }
+    if [catch { package require Expect } ExpectHere] {
+       puts stderr "Warning : You'll need package Expect to use WOK integration package.."
+       puts stderr "          Check for variable TCLLIBPATH"
+    }
+    
+    ;#
+    set savpwd [pwd]
+    
+    ;#
+    ;# Create factory FNAM and warehouse attached to it
+    ;#
+    if { ![wokinfo -x ${FNAM}] } {
+       puts "Creating the factory : ${FNAM}"
+       if ![catch {fcreate -DHome=$HOME_ENTITIES/${FNAM} -d ${FNAM} } astatus ] {
+           wokcd ${FNAM}
+           if { ![wokinfo -x ${FNAM}:BAG] } {
+               puts "Creating the WareHouse in $HOME_ENTITIES/${FNAM}/BAG"
+               if [ catch {Wcreate -DHome=$HOME_ENTITIES/${FNAM}/BAG -d -DAdm=$HOME_ENTITIES/${FNAM}/BAG/adm BAG } astatus ] {
+                   puts $astatus
+                   cd $savpwd
+               }
+           }
+       } else {
+           puts $astatus
+           cd $savpwd
+       }
+    }
+    
+    ;#
+    ;# Create workshop WSNAM
+    ;#
+    if { ![wokinfo -x ${FNAM}:${WSNAM}] } {
+       puts "Creating the workshop : ${FNAM}:${WSNAM}"
+       if ![ catch {screate -DHome=$HOME_ENTITIES/${FNAM}/${WSNAM} -d ${WSNAM} } astatus] {
+           wokcd -PAdm ${FNAM}:${WSNAM} 
+       } else {
+           puts $astatus
+           cd $savpwd
+       }
+    }
+    ;#
+    ;# Create workbench WBNAM 
+    ;#
+    if { ![wokinfo -x ${FNAM}:${WSNAM}:${WBNAM}] } {
+       puts "Creating the workbench : ${FNAM}:${WSNAM}:${WBNAM}"
+       wokcd ${FNAM}:${WSNAM}
+       set WBROOT $HOME_ENTITIES/${FNAM}/${WSNAM}/${WBNAM}
+       if [ catch {wcreate -DHome=$IMPORT_DIR -d ${WBNAM} } astatus] {
+           puts $astatus
+           cd $savpwd
+           exit
+       }
+    }
+        
+    if { "$IMPORT_DIR" != {} } {
+       wokcd -PAdm ${FNAM}:${WSNAM}:${WBNAM}
+       foreach udl [glob -nocomplain *.UDLIST] {
+           puts "Importing units from module $udl"
+           foreach unit [FileToList $udl] {
+               if [ catch { ucreate -[lindex $unit 0] [lindex $unit 1] } astatus] {
+                   puts $astatus
+               }
+           }
+       }
+    }
+    cd $savpwd
+}
+
+set CASHOME [file dirname $env(CASROOT)/.]
+
+CreateFactory $env(WOK_ROOTADMDIR) OS OCC51 ros $CASHOME
+puts "WOK initialization was done"
+exit
+
+
+
index 609afe528337c3d17fb727f8d7bf397b995e76f9..b522c7b92c0192f02f6707c816d8d935d16d51cf 100755 (executable)
@@ -42,7 +42,7 @@
 ;# choose.
 ;#
 global env tcl_platform
-set env(PATH) $env(Path)
+
 if { "$tcl_platform(platform)" == "unix" && ![info exists env(LD_LIBRARY_PATH)] } {
     puts stderr "You must set LD_LIBRARY_PATH to point where you have installed Wok"
     exit
@@ -168,7 +168,7 @@ set tcl_prompt1 {if {[info commands wokcd] != ""}  then \
        {puts -nonewline stdout "[wokcd]> "} else \
        {puts -nonewline stdout "tclsh> "}}
 if { "$tcl_platform(platform)" == "windows" } {
-   source $env(WOKHOME)/lib/cmd-input.tcl
+   source $env(WOKHOME)/site/cmd-input.tcl
 }
 cd $env(WOK_ROOTADMDIR)
 wokclose -a
index 16445f6a14d19fe8ade0b69939d6da9ea2abc71f..23d1846dce7008317da601b6b1eac3a578bb45ef 100755 (executable)
@@ -6,26 +6,41 @@
 # 
 #
 set noglob ; set narg = $#argv 
-if ( $narg > 3 || $narg == 1 || $narg == 0 ) then
+if ( $narg > 3) then
   echo "Usage : wok.csh wok_home wok_entities [tclhome] "
-  echo "        wok_home(required)     is the path of directory for wok shareable (Ex: <root>/lib/sun) "
-  echo "        wok_entities(required) is the path of an ATLIST file."
+  echo "        wok_home(optional)     is the path of directory for wok shareable (Ex: <root>/lib/sun) "
+  echo "        wok_entities(optional) is the path of an ATLIST file."
   echo "        tclhome(optional)      is the home directory of a Tcl distribution."
   echo "   "
   exit
 endif
 
+if ( $narg == 0 && ! ($?CASROOT)) then
+echo -n "Please define CASROOT to the folder containing OpenCascade '"'src'"', '"'drv'"' and '"'inc'"' folders. :"
+set res = $<
+setenv CASROOT ${res}
+endif
+
+if ( $narg == 0) then
+  setenv WOKHOME $CASROOT/../wok
+  setenv WOK_ROOTADMDIR $WOKHOME/wok_entities
+endif
+
+if ( $narg == 1) then
+  setenv WOKHOME $argv[1]
+  setenv WOK_ROOTADMDIR $WOKHOME/wok_entities
+endif
+
 if ( $narg == 2 ) then
-  set  wokhome=$argv[1]
+  setenv WOKHOME $argv[1]
   setenv WOK_ROOTADMDIR $argv[2]
 endif
 
 
-set TCLHOME=/usr
 if ( $narg == 3 ) then
-   set wokhome=$argv[1]
+   setenv WOKHOME $argv[1]
    setenv WOK_ROOTADMDIR $argv[2]
-   set TCLHOME=$argv[3]
+   setenv TCLHOME $argv[3]
 endif
 
 
@@ -37,7 +52,20 @@ endif
 if ( ! ($?LD_LIBRARY_PATH) ) then
     setenv LD_LIBRARY_PATH ""
 endif
-setenv LD_LIBRARY_PATH "${TCLLIB}:${wokhome}:${LD_LIBRARY_PATH}:"
+
+switch ( `uname` )
+    case SunOS:
+       setenv WOKSTATION "sun"
+       breaksw
+    case Linux:
+       setenv WOKSTATION "lin"
+       breaksw
+    default:
+       echo "Error : unknown platform"
+       breaksw
+endsw
+
+setenv LD_LIBRARY_PATH "${TCLLIB}:${WOKHOME}/lib/${WOKSTATION}:${LD_LIBRARY_PATH}:"
 ${TCLBIN}/tclsh