home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / config_forte.tcl < prev    next >
Encoding:
Text File  |  1997-04-11  |  1.6 KB  |  50 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc. 1997
  4. #
  5. #      File:        @(#)config_forte.tcl    /main/hindenburg/1
  6. #      Description:    Configure Forte Environment, i.e. import systems
  7. #            'Framework' and 'DisplayProject' into ObjectDesign
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)config_forte.tcl    /main/hindenburg/1    11 Apr 1997    Copyright 1997 Cayenne Software Inc.
  10.  
  11. proc importBuiltins {} {
  12.     set cc [ClientContext::global]
  13.     set phaseV [$cc currentPhase]
  14.     foreach sys {Framework DisplayProject} {
  15.     set sysV [$phaseV findSystemVersion $sys "system"]
  16.     if {![$sysV isNil]} {
  17.         puts -nonewline "System '$sys' already exists. Configure again? \[no]: "
  18.         set answer [gets stdin]
  19.         switch -glob -- [string tolower $answer] {
  20.         y*    {puts ""}
  21.         default    {continue}
  22.         }
  23.     }
  24.  
  25.     set srcDir [location [m4_var get M4_home] config src forte]
  26.     set file [path_name concat $srcDir $sys tcl]
  27.     if {![file exist $file]} {
  28.         puts "Import of system '$sys' failed: file '$file' not found."
  29.     } else {
  30.         puts "Importing system '$sys'...  (this action will take some time)"
  31.         source $file
  32.     }
  33.     puts ""
  34.     }
  35. }
  36.  
  37.  
  38. puts "Configure Forte Environment"
  39. puts "===========================\n"
  40.  
  41. set cc [ClientContext::global]
  42. set phaseType [[[$cc currentPhase] phase] type]
  43. if {$phaseType == "ObjectDesign"} {
  44.     importBuiltins
  45.     puts "\n'Configure Forte Environment' finished."
  46. } else {
  47.     puts "'Configure Forte Environment' failed: invalid phase type '$phaseType'."
  48. }
  49.  
  50.