Diff
Not logged in

Differences From Artifact [e3ff1b2b28]:

To Artifact [cc15863c0a]:


332
333
334
335
336
337
338




































339
340
341
342
343
344
345
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







    #       Generally, this is not needed on Windows machines.
    #
    variable monoInstalledPattern; # DEFAULT: ^Mono JIT compiler version \d+\.

    if {![info exists monoInstalledPattern]} then {
      set monoInstalledPattern {^Mono JIT compiler version \d+\.}
    }

    #
    # NOTE: This is the name of the executable file used to invoke the
    #       .NET Core implementation, possibly without a file extension.
    #
    variable dotnetFileNameOnly; # DEFAULT: <unset>

    if {![info exists dotnetFileNameOnly]} then {
      if {[isWindows]} then {
        set dotnetFileNameOnly dotnet.exe
      } else {
        set dotnetFileNameOnly dotnet
      }
    }

    #
    # NOTE: The command to use when attempting to verify that .NET Core and
    #       its associated runtimes are installed locally.  Generally, this
    #       is not needed on Windows machines.
    #
    variable dotnetInstalledCommand; # DEFAULT: dotnet --version

    if {![info exists dotnetInstalledCommand]} then {
      set dotnetInstalledCommand {{${dotnetFileNameOnly}} --version}
    }

    #
    # NOTE: The regular expression pattern used when attempting to verify
    #       that .NET Core and its associated runtimes are installed locally.
    #       Generally, this is not needed on Windows machines.
    #
    variable dotnetInstalledPattern; # DEFAULT: ^\d+\.\d+(?:\.\d+)*$

    if {![info exists dotnetInstalledPattern]} then {
      set dotnetInstalledPattern {^\d+\.\d+(?:\.\d+)*$}
    }
  }

  #
  # NOTE: This procedure modifies the URN variables used by the package
  #       downloader client so that one or more alternative (private?)
  #       backend file servers may be used.  The serverId argument must
  #       consist only of alphanumeric characters and it must begin with
864
865
866
867
868
869
870


































871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889


890
891

892
893
894
895
896
897
898
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957


958
959
960

961
962
963
964
965
966
967
968







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

















-
-
+
+

-
+







        ![regexp -- $monoInstalledPattern $result]} then {
      return false
    }

    return true
  }

  #
  # NOTE: This procedure attempts to verify that an instance of .NET Core
  #       and its associated runtimes are installed locally.  There are no
  #       arguments.  The return value is non-zero if Mono appears to be
  #       installed and available for use; otherwise, the return value is
  #       zero.
  #
  proc isDotNetCoreInstalled {} {
    variable dotnetFileNameOnly
    variable dotnetInstalledCommand
    variable dotnetInstalledPattern

    if {[isEagle]} then {
      if {[catch {
        eval exec -success Success [subst $dotnetInstalledCommand]
      } result]} then {
        return false
      }
    } else {
      if {[catch {
        eval exec [subst $dotnetInstalledCommand]
      } result]} then {
        return false
      }
    }

    if {![info exists result] || \
        ![regexp -- $dotnetInstalledPattern [string trim $result]]} then {
      return false
    }

    return true
  }

  #
  # NOTE: This procedure attempts to verify that some runtime is available to
  #       run CLR applications locally (e.g. the .NET Framework or Mono JIT).
  #       There are no arguments.  The return value is non-zero if it appears
  #       that CLR applications should be runnable locally; otherwise, the
  #       return value is zero.
  #
  proc canUseMsilPlatform {} {
    if {[isWindows]} then {
      #
      # HACK: Assume that all Windows operating systems have a compatible
      #       version of the .NET Framework is installed -AND- that it can
      #       be used to run any CLR application.
      #
      return true
    } else {
      #
      # HACK: On all other platforms, assume that Mono can be used to run
      #       any CLR application.
      # HACK: On all other platforms, assume that Mono -OR- .NET Core can
      #       be used to run any CLR application.
      #
      return [isMonoInstalled]
      return [expr {[isMonoInstalled] || [isDotNetCoreInstalled]}]
    }
  }

  #
  # NOTE: This procedure verifies that the specified value is indeed a valid
  #       package name.  The packageName argument is the value to verify.
  #       This procedure may raise script errors.