Check-in [ee4b3f2fc1]
Not logged in
Overview
Comment:Add the Garuda pacakge for 'x64' (beta 40 release).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ee4b3f2fc171872fac460b90d54aaa7d06980857
User & Date: mistachkin on 2017-10-19 00:47:26
Other Links: manifest | tags
Context
2017-10-19
02:49
Move the Mono and Fossil executable file names to their own variables. check-in: 3a41cb39ee user: mistachkin tags: trunk
00:47
Add the Garuda pacakge for 'x64' (beta 40 release). check-in: ee4b3f2fc1 user: mistachkin tags: trunk
2017-10-18
23:50
Bump client version to '1.0.2'. check-in: ff15d19f5e user: mistachkin tags: trunk
Changes

Added packages/tcl/8.4/win64-x64/Garuda1.0/Garuda.dll version [1514fde72b].

cannot compute difference between binary files

Added packages/tcl/8.4/win64-x64/Garuda1.0/Garuda.dll.asc version [3843cc85d6].



















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository

iQIcBAABCAAGBQJZ5/UxAAoJEFAslq9JXcLZZCUQAJY4NCDw2FKtozc4AzvUKlw5
eC4eQOOEyTnvAeQCFv1RnlxGo6CwhM20JHsu1O+9S7ONBx5wB72SWkzDinS2GoAB
nI/kjIiD9Px8K4umhmW1M0n9QhzJVW+j9AakXYsDsvqOriW8mFGtN6GBPfxd+w7s
17+T5Y+twqqAFreq+gEtvZEKFWEHojU7z276etd32WVQOo7DEKj8JbUtzqOJhmVE
8BK6f9LboCfYVm/ACrwOC2r2wSwCOBSK8cN7KqUyX3uu2ZqXIKz4525wXi6ePvfK
Ltlwck4faxW6ChTdFmVVuLFqwLfiJm35rCR3yRZBdXYKZFIoNIxiSyG8ObylvKH5
+vrTAEvBBgOmGWghda04Wxl7bnfD6++f1GfZY1CKahyRU8HvcXCeZSuveKlm2HYn
vjzg9pWtdVD/Y8r6UFuUPtuC4BQfypow2YhS3ib1goA9grobXrtdqOu/B5Dy2s7G
MfLwqJ7Gkh/jkkzR3yjzb2q0/ONkCM3Gl8BSbKaUi1QAA5RV5pWAs6ZzLgy8r3Z+
Q1cu/Y4nLmMnfUnrqV9ceoM0W9XorTXWyk0YcVOzF4FOrXx9H++MM7MNlUT4i4y6
707fpzpSajjl2PYJpoAgOZiQhoaAyU0BtBa2r8qd5KGrA5etDRj11zFeFKPaRtCQ
3MtIQB2Fu/ir53RwR5U0
=amv2
-----END PGP SIGNATURE-----

Added packages/tcl/8.4/win64-x64/Garuda1.0/Scripts/ex_winForms.tcl version [79d3590e86].






































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
###############################################################################
#
# ex_winForms.tcl --
#
# Copyright (c) 2007-2012 by Joe Mistachkin.  All rights reserved.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: $
#
###############################################################################

package require Tk
package require Garuda

wm withdraw .

if {![info exists i]} then { set i 0 }; incr i

set toplevel [toplevel .example$i]

wm title $toplevel "Garuda Example (TkWindow #$i)"
wm geometry $toplevel 350x100

bind $toplevel <F2> {console show}

set script [string map [list %i% $i] {
  #
  # NOTE: This script can use any of the commands provided by
  #       Eagle (e.g. [object invoke] to invoke .NET Framework
  #       objects).
  #
  proc handleClickEvent { sender e } {
    set title "About Garuda Example #%i%"

    if {[tcl ready]} then {
      msgBox [appendArgs "Tcl version is: " \
          [tcl eval [tcl master] info patchlevel] \n \
          "Eagle version is: " [info engine patchlevel]] $title
    } else {
      msgBox "Tcl is not ready." $title
    }
  }

  object load -import System.Windows.Forms
  interp alias {} msgBox {} object invoke MessageBox Show

  set form [object create -alias Form]

  $form Width 350; $form Height 100
  $form Text "Garuda Example (WinForm #%i%)"
  $form Show

  set button [object create -alias Button]

  $button Left [expr {([$form ClientSize.Width] - [$button Width]) / 2}]
  $button Top [expr {([$form ClientSize.Height] - [$button Height]) / 2}]

  $button Text "Click Here"
  $button add_Click handleClickEvent

  object invoke $form.Controls Add $button
}]

set button [button $toplevel.run -text "Click Here" \
    -command [list eagle $script]]

pack $button -padx 20 -pady 20 -ipadx 10 -ipady 10

Added packages/tcl/8.4/win64-x64/Garuda1.0/Scripts/ex_winForms.tcl.asc version [bb95488262].



















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository

iQIcBAABCAAGBQJYAbN0AAoJEFAslq9JXcLZXQIP/jYpRRRQUSRCgyA1S6ZH+Gfk
01npl8dkeeF+crDlQgXwkrNzZnTw227YlY3egHNZ87k+sl28+aalHDP29t+ba6Kq
u3JE9YZts9VOUxtT8H+GS6RhOgkxwLUIoxVe+erUWAo7jvxrKxXmuCtBrqrwK4PA
WiPxajtM2arKp86Wz3AEU2QwLBf1vrGXqZLk2VMbvwlw6xvicckNGWfuT/FOqGVq
9wv3Gdglzh6p387MJ0QPzlr7mwAe3VV7AdICz9GHM0rSDAtM0monw9MSyNmQq9si
HXM49KXGGt0kVEtvZnXroaZrqXbwaaOvD1EKDwqvJ12oTD/sHfa+iR/R0LBo0+0Y
XfL5mLGrzKYj6G+xiR7/TeViigPBFl4ErgeujAhJw7gyp8qxW7zBsH8Ga15hoEEp
smEkSH2C+ujihdBKPmbvcOeuUMBntxoNFb8QF6qSSyqlfx5id3I9U3iUsmuhXNo7
z9VvCfmfMHRMO4XiLO7KtswhAo9yaDTB6ag4GtTnwZAEbQfrnXzA3fGf/HuhovP2
Axw0Ak+XbnROIQvaug6wVBjLpEyGHtjEigBBYBi84NvyrN0YOksFyqiq7OStk6s1
obHxaORoHVf13ccN1JxuHcG2RgCI3kKELs/VfRGfSjvngWMUdWnWcJS4+W3suLjZ
YvQ0D3MQ+35JhRbBvqLx
=zLO2
-----END PGP SIGNATURE-----

Added packages/tcl/8.4/win64-x64/Garuda1.0/Tests/all.tcl version [7543856fec].




















































































































































































































































































































































































































































































































































































































































































































































































































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
###############################################################################
#
# all.tcl --
#
# This file contains a top-level script to run all of the Garuda tests.
# Execute it by invoking "source all.eagle".
#
# Extensible Adaptable Generalized Logic Engine (Eagle)
# Test Suite File
#
# Copyright (c) 2007-2012 by Joe Mistachkin.  All rights reserved.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: $
#
###############################################################################

#
# NOTE: This script file uses features that are only present in Tcl 8.4 or
#       higher (e.g. the "eq" operator for [expr], etc).
#
if {![package vsatisfies [package provide Tcl] 8.4]} then {
  error "need Tcl 8.4 or higher"
}

#
# NOTE: This script file uses features that are not available or not needed
#       in Eagle (e.g. the "http" and "tls" packages, etc).
#
if {[catch {package present Eagle}] == 0} then {
  error "need native Tcl"
}

###############################################################################

namespace eval ::Garuda {
  #############################################################################
  #**************************** SHARED PROCEDURES *****************************
  #############################################################################

  #
  # NOTE: Stolen from "helper.tcl" because this procedure is needed prior to
  #       the Garuda package being loaded.
  #
  proc lappendUnique { varName args } {
    upvar 1 $varName list

    foreach arg $args {
      if {[lsearch -exact $list $arg] == -1} then {
        lappend list $arg
      }
    }
  }

  #
  # NOTE: Stolen from "helper.tcl" because this procedure is needed prior to
  #       the Garuda package being loaded.
  #
  proc maybeFullName { command } {
    set which [namespace which $command]

    if {[string length $which] > 0} then {
      return $which
    }

    return $command
  }

  #
  # NOTE: Stolen from "helper.tcl" because this procedure is needed prior to
  #       the Garuda package being loaded.
  #
  proc fileNormalize { path {force false} } {
    variable noNormalize

    if {$force || !$noNormalize} then {
      return [file normalize $path]
    }

    return $path
  }

  #
  # NOTE: Stolen from "helper.tcl" because this procedure is needed prior to
  #       the Garuda package being loaded.
  #
  proc isValidDirectory { path } {
    variable logCommand
    variable verbose

    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level -1] 0]]

        eval $logCommand [list \
            "$caller: Checking for directory \"$path\" from \"[pwd]\"..."]
      }
    }

    #
    # NOTE: For now, just make sure the path refers to an existing directory.
    #
    return [expr {[string length $path] > 0 && [file exists $path] && \
        [file isdirectory $path]}]
  }

  #
  # NOTE: Stolen from "helper.tcl" because this procedure is needed prior to
  #       the Garuda package being loaded.
  #
  proc isValidFile { path } {
    variable logCommand
    variable verbose

    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level -1] 0]]

        eval $logCommand [list \
            "$caller: Checking for file \"$path\" from \"[pwd]\"..."]
      }
    }

    #
    # NOTE: For now, just make sure the path refers to an existing file.
    #
    return [expr {[string length $path] > 0 && [file exists $path] && \
        [file isfile $path]}]
  }

  #############################################################################
  #**************************** UTILITY PROCEDURES ****************************
  #############################################################################

  proc findPackagePath {
          varNames varSuffixes name version platforms configurations directory
          binaryFileName indexFileName } {
    global env

    #
    # NOTE: Construct the name of the base name of the directory that should
    #       contain the package itself, including its binary.
    #
    set nameAndVersion [join [list $name $version] ""]

    #
    # NOTE: Check if the package can be found using the list of environment
    #       variables specified by the caller.
    #
    foreach varName $varNames {
      #
      # NOTE: Check each of the environment variable name suffixes specified
      #       by the caller prior to trying the environment variable name by
      #       itself.
      #
      foreach varSuffix $varSuffixes {
        set newVarName ${varName}${varSuffix}

        if {[info exists env($newVarName)]} then {
          set path [file join [string trim $env($newVarName)] \
              $binaryFileName]

          if {[isValidFile $path]} then {
            set path [file join [file dirname $path] \
                $indexFileName]

            if {[isValidFile $path]} then {
              return [file dirname $path]
            }
          }
        }
      }

      if {[info exists env($varName)]} then {
        set path [file join [string trim $env($varName)] \
            $binaryFileName]

        if {[isValidFile $path]} then {
          set path [file join [file dirname $path] \
              $indexFileName]

          if {[isValidFile $path]} then {
            return [file dirname $path]
          }
        }
      }
    }

    #
    # NOTE: Check the in-development directories for the package being tested,
    #       based on the provided build platforms and configurations.
    #
    foreach platform $platforms {
      foreach configuration $configurations {
        set path [file join $directory bin $platform \
            $configuration $binaryFileName]

        if {[isValidFile $path]} then {
          set path [file join [file dirname $path] \
              $indexFileName]

          if {[isValidFile $path]} then {
            return [file dirname $path]
          }
        }
      }
    }

    #
    # NOTE: Check the in-deployment directory for the package being tested.
    #
    set path [file join $directory $nameAndVersion \
        $binaryFileName]

    if {[isValidFile $path]} then {
      set path [file join [file dirname $path] \
          $indexFileName]

      if {[isValidFile $path]} then {
        return [file dirname $path]
      }
    }

    return ""
  }

  proc addToAutoPath { directory } {
    global auto_path

    #
    # NOTE: Attempt to make absolutely sure that the specified directory is
    #       not already present in the auto-path by checking several of the
    #       various forms it may take.
    #
    if {[lsearch -exact $auto_path $directory] == -1 && \
        [lsearch -exact $auto_path [fileNormalize $directory true]] == -1 && \
        [lsearch -exact $auto_path [file nativename $directory]] == -1} then {
      #
      # BUGFIX: Make sure that the specified directory is the *FIRST* one
      #         that gets searched for the package being tested; otherwise,
      #         we may end up loading and testing the wrong package binary.
      #
      set auto_path [linsert $auto_path 0 $directory]
    }
  }

  #############################################################################
  #********************** TEST VARIABLE SETUP PROCEDURES **********************
  #############################################################################

  proc setupTestPackageConfigurations { force } {
    variable testPackageConfigurations; # DEFAULT: {DebugDll ReleaseDll ""}

    if {$force || ![info exists testPackageConfigurations]} then {
      #
      # NOTE: Always start with no configurations.
      #
      set testPackageConfigurations [list]

      #
      # NOTE: If there is a build suffix, use it to enhance the default list
      #       of configurations.
      #
      if {[info exists ::test_flags(-suffix)] && \
          [string length $::test_flags(-suffix)] > 0} then {
        #
        # NOTE: First, add each of the default configurations with the build
        #       suffix appended to them.
        #
        lappend testPackageConfigurations DebugDll${::test_flags(-suffix)}
        lappend testPackageConfigurations ReleaseDll${::test_flags(-suffix)}
      }

      lappend testPackageConfigurations DebugDll ReleaseDll ""
    }
  }

  proc setupTestVariables {} {
    global tcl_platform

    ###########################################################################
    #*********** NATIVE PACKAGE DIAGNOSTIC CONFIGURATION VARIABLES ************
    ###########################################################################

    #
    # NOTE: Display diagnostic messages while searching for the package being
    #       tested and setting up the tests?  This variable may be shared with
    #       the package being tested; therefore, change it with care.
    #
    variable verbose; # DEFAULT: true

    if {![info exists verbose]} then {
      set verbose true
    }

    #
    # NOTE: The Tcl command used to log warnings, errors, and other messages
    #       generated by the package being tested.  This variable may be shared
    #       with the package being tested; therefore, change it with care.
    #
    variable logCommand; # DEFAULT: tclLog

    if {![info exists logCommand]} then {
      set logCommand tclLog
    }

    #
    # NOTE: When this is non-zero, the [file normalize] sub-command will not
    #       be used on the assembly path.  This is necessary in some special
    #       environments due to a bug in Tcl where it will resolve junctions
    #       as part of the path normalization process.
    #
    variable noNormalize; # DEFAULT: false

    if {![info exists noNormalize]} then {
      set noNormalize false
    }

    ###########################################################################
    #********************* NATIVE PACKAGE TEST VARIABLES **********************
    ###########################################################################

    #
    # NOTE: Automatically run all the tests now instead of waiting for the
    #       runPackageTests procedure to be executed?
    #
    variable startTests; # DEFAULT: true

    if {![info exists startTests]} then {
      set startTests true
    }

    #
    # NOTE: The environment variable names to check when attempting to find the
    #       Garuda binary directory.  This list is used during the file search
    #       process from within the [runPackageTests] procedure.
    #
    variable testEnvVars; # DEFAULT: "Garuda_Dll Garuda GarudaLkg Lkg"

    if {![info exists testEnvVars]} then {
      set testEnvVars [list Garuda_Dll Garuda GarudaLkg Lkg]
    }

    #
    # NOTE: The strings to append to the environment variable names listed
    #       above when attempting to find the Garuda binary directory.  This
    #       list is used during the file search process from within the
    #       [runPackageTests] procedure.
    #
    variable testEnvVarSuffixes; # DEFAULT: "_Temp Temp _Build Build"

    if {![info exists testEnvVarSuffixes]} then {
      set testEnvVarSuffixes [list _Temp Temp _Build Build]
    }

    #
    # NOTE: The build platforms for the package being tested that we know about
    #       and support.
    #
    variable testPackagePlatforms; # DEFAULT: "Win32 x64" OR "x64 Win32"

    if {![info exists testPackagePlatforms]} then {
      #
      # NOTE: Attempt to select the appropriate platforms (architectures)
      #       for this machine.
      #
      if {[info exists tcl_platform(machine)] && \
          $tcl_platform(machine) eq "amd64"} then {
        #
        # NOTE: We are running on an x64 machine, prefer it over x86.
        #
        set testPackagePlatforms [list x64 Win32]
      } else {
        #
        # NOTE: We are running on an x86 machine, prefer it over x64.
        #
        set testPackagePlatforms [list Win32 x64]
      }
    }

    #
    # NOTE: The build configurations for the package being tested that we know
    #       about and support.
    #
    setupTestPackageConfigurations false

    #
    # NOTE: The name of the package being tested.
    #
    variable testPackageName; # DEFAULT: Garuda

    if {![info exists testPackageName]} then {
      set testPackageName \
          [lindex [split [string trim [namespace current] :] :] 0]
    }

    #
    # NOTE: The version of the package being tested.
    #
    variable testPackageVersion; # DEFAULT: 1.0

    if {![info exists testPackageVersion]} then {
      set testPackageVersion 1.0
    }

    #
    # NOTE: The name of the dynamic link library file containing the native
    #       code for the package being tested.
    #
    variable testBinaryFileName; # DEFAULT: Garuda.dll

    if {![info exists testBinaryFileName]} then {
      set testBinaryFileName $testPackageName[info sharedlibextension]
    }

    #
    # NOTE: The name of the Tcl package index file.
    #
    variable testPackageIndexFileName; # DEFAULT: pkgIndex.tcl

    if {![info exists testPackageIndexFileName]} then {
      set testPackageIndexFileName pkgIndex.tcl
    }

    #
    # NOTE: The name of the directory where the dynamic link library file
    #       containing the native code for the package being tested resides.
    #
    variable testBinaryPath; # DEFAULT: <unset>

    #
    # NOTE: The names of the Eagle test suite files to run.
    #
    variable testFileNames; # DEFAULT: tcl-load.eagle

    if {![info exists testFileNames]} then {
      set testFileNames [list tcl-load.eagle]
    }

    #
    # NOTE: The name of the main Eagle test suite file.
    #
    variable testSuiteFileName; # DEFAULT: all.eagle

    if {![info exists testSuiteFileName]} then {
      set testSuiteFileName all.eagle
    }
  }

  #############################################################################
  #************************** TEST STARTUP PROCEDURE **************************
  #############################################################################

  proc runPackageTests { directory } {
    global argv
    global auto_path
    variable envVars
    variable envVarSuffixes
    variable logCommand
    variable rootRegistryKeyName
    variable testBinaryFileName
    variable testBinaryPath
    variable testEnvVars
    variable testEnvVarSuffixes
    variable testFileNames
    variable testPackageConfigurations
    variable testPackageIndexFileName
    variable testPackageName
    variable testPackagePlatforms
    variable testPackageVersion
    variable testSuiteFileName
    variable useEnvironment
    variable useLibrary
    variable useRegistry
    variable useRelativePath
    variable verbose

    #
    # HACK: Scan for and then process the "-baseDirectory", "-configuration",
    #       "-suffix", "-preTest", and "-postTest" command line arguments. The
    #       first one may be used to override the base directory that is used
    #       when attempting to locate the package binaries and the master Eagle
    #       test suite file (e.g. "all.eagle").  The next two are needed by the
    #       "helper.tcl" script to locate the proper Eagle assembly to load and
    #       use for the tests.  The final two may be needed to support various
    #       tests.
    #
    foreach {name value} $argv {
      switch -exact -- $name {
        -baseDirectory {
          #
          # NOTE: Use the base directory from the command line verbatim.  This
          #       will be picked up and used later in this procedure to help
          #       locate the package binaries as well as the master Eagle test
          #       suite file (e.g. "all.eagle").
          #
          set [string trimleft $name -] $value

          #
          # NOTE: Show that we set this option (in the log).
          #
          if {$verbose} then {
            catch {
              set caller [maybeFullName [lindex [info level 0] 0]]

              eval $logCommand [list \
                  "$caller: Set option \"$name\" to value \"$value\"."]
            }
          }
        }
        -configuration -
        -suffix {
          #
          # NOTE: This will be picked up by the "helper.tcl" file.
          #
          set ::test_flags($name) $value

          #
          # NOTE: Show that we set this option (in the log).
          #
          if {$verbose} then {
            catch {
              set caller [maybeFullName [lindex [info level 0] 0]]

              eval $logCommand [list \
                  "$caller: Set option \"$name\" to value \"$value\"."]
            }
          }

          #
          # HACK: If we are changing the suffix, re-check the test package
          #       configurations.
          #
          if {$name eq "-suffix"} then {
            setupTestPackageConfigurations true
          }
        }
        -preTest -
        -postTest {
          #
          # NOTE: Set the local variable (minus leading dashes) to the value,
          #       which is a script to evaluate before/after the test itself.
          #
          set [string trimleft $name -] $value

          #
          # NOTE: Show that we set this option (in the log).
          #
          if {$verbose} then {
            catch {
              set caller [maybeFullName [lindex [info level 0] 0]]

              eval $logCommand [list \
                  "$caller: Set option \"$name\" to value \"$value\"."]
            }
          }
        }
      }
    }

    #
    # NOTE: Skip setting the base directory if it already exists (e.g. it has
    #       been set via the command line).
    #
    if {![info exists baseDirectory]} then {
      #
      # NOTE: When running in development [within the source tree], this should
      #       give us the "Native" directory.  When running in deployment (e.g.
      #       "<Tcl>\lib\Garuda1.0\tests"), this should give us the application
      #       (or Tcl) library directory (i.e. the one containing the various
      #       package sub-directories).
      #
      set baseDirectory [file dirname [file dirname $directory]]

      #
      # NOTE: Attempt to detect if we are running in development [within the
      #       source tree] by checking if the base directory is now "Native".
      #       In that case, we need to go up another level to obtain the root
      #       Eagle source code directory (i.e. the directory with the "bin",
      #       "Library", and "Native" sub-directories).
      #
      if {[file tail $baseDirectory] eq "Native"} then {
        set baseDirectory [file dirname $baseDirectory]
      }
    }

    #
    # NOTE: Show the effective base directory now.
    #
    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level 0] 0]]

        eval $logCommand [list \
            "$caller: Base directory is \"$baseDirectory\"."]
      }
    }

    #
    # NOTE: Attempt to find binary file for the package being tested using the
    #       configured platforms, configurations, and file name.
    #
    if {[info exists testBinaryPath]} then {
      #
      # NOTE: The path has probably been pre-configured by an external script;
      #       therefore, just use it verbatim.
      #
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using existing binary path \"$testBinaryPath\"..."]
        }
      }
    } else {
      set path [findPackagePath $testEnvVars $testEnvVarSuffixes \
          $testPackageName $testPackageVersion $testPackagePlatforms \
          $testPackageConfigurations $baseDirectory $testBinaryFileName \
          $testPackageIndexFileName]

      if {[isValidDirectory $path]} then {
        set testBinaryPath $path
      }
    }

    #
    # NOTE: Double-check that the configured directory is valid.
    #
    if {[info exists testBinaryPath] && \
        [isValidDirectory $testBinaryPath]} then {
      #
      # NOTE: Success, we found the necessary binary file.  Add the directory
      #       containing the file to the Tcl package search path if it is not
      #       already present.
      #
      if {[lsearch -exact $auto_path $testBinaryPath] != -1} then {
        if {$verbose} then {
          catch {
            set caller [maybeFullName [lindex [info level 0] 0]]

            eval $logCommand [list \
                "$caller: Binary path already present in \"auto_path\"."]
          }
        }
      } else {
        addToAutoPath $testBinaryPath
      }

      #
      # NOTE: Evaluate the pre-test script now, if any.  This must be done
      #       prior to loading the actual Tcl package; otherwise, we cannot
      #       impact the (embedded) Eagle interpreter creation process.
      #
      if {[info exists preTest]} then {
        uplevel #0 $preTest
      }

      #
      # NOTE: Attempt to require the package being tested now.  This should
      #       end up sourcing the "helper.tcl" file, which must also provide
      #       us with the "envVars", "rootRegistryKeyName", "useEnvironment",
      #       "useLibrary", "useRegistry", and "useRelativePath" Tcl variables
      #       that we need.
      #
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using final binary path \"$testBinaryPath\"..."]
        }
      }

      package require $testPackageName $testPackageVersion

      #
      # NOTE: Configure the Eagle test suite to run only the specified file(s)
      #       unless it has already been configured otherwise.
      #
      if {[lsearch -exact $argv -file] != -1} then {
        if {$verbose} then {
          catch {
            set caller [maybeFullName [lindex [info level 0] 0]]

            eval $logCommand [list \
                "$caller: Option \"-file\" already present in \"argv\"."]
          }
        }
      } else {
        #
        # NOTE: No file option found, add it.
        #
        lappend argv -file $testFileNames

        #
        # NOTE: Show that we set this option (in the log).
        #
        if {$verbose} then {
          catch {
            set caller [maybeFullName [lindex [info level 0] 0]]

            eval $logCommand [list \
                "$caller: Set option \"-file\" to \"$testFileNames\"."]
          }
        }
      }

      #
      # NOTE: Build the list of directories to search for the main Eagle test
      #       suite file.
      #
      set testSuiteDirectories [list]

      eval lappendUnique testSuiteDirectories [list \
          [file join $baseDirectory Library] $baseDirectory]

      if {$useRelativePath} then {
        eval lappendUnique testSuiteDirectories [getRelativePathList \
            [list $directory [file dirname $directory] \
            $baseDirectory [file dirname $baseDirectory] \
            [file dirname [file dirname $baseDirectory]]] \
            $testPackageConfigurations]
      }

      if {$useEnvironment} then {
        eval lappendUnique testSuiteDirectories [getEnvironmentPathList \
            $envVars $envVarSuffixes]
      }

      if {$useRegistry} then {
        eval lappendUnique testSuiteDirectories [getRegistryPathList \
            $rootRegistryKeyName Path]
      }

      if {$useLibrary} then {
        eval lappendUnique testSuiteDirectories [getLibraryPathList]
      }

      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Final list of directories to search:\
              $testSuiteDirectories"]
        }
      }

      #
      # NOTE: Search for the main Eagle test suite file in all the configured
      #       directories, stopping when found.
      #
      foreach testSuiteDirectory $testSuiteDirectories {
        set testFileName [file join $testSuiteDirectory Tests \
            $testSuiteFileName]

        if {[isValidFile $testFileName]} then {
          break
        }
      }

      #
      # NOTE: Did we find the main Eagle test suite file?
      #
      if {[info exists testFileName] && [isValidFile $testFileName]} then {
        #
        # NOTE: Attempt to run the Eagle test suite now.
        #
        if {$verbose} then {
          catch {
            set caller [maybeFullName [lindex [info level 0] 0]]

            eval $logCommand [list \
                "$caller: Using final test file name \"$testFileName\"..."]
          }
        }

        uplevel #0 [list source $testFileName]

        #
        # NOTE: Evaluate the post-test script now, if any.
        #
        if {[info exists postTest]} then {
          uplevel #0 $postTest
        }
      } else {
        error "cannot locate Eagle test suite file: $testSuiteFileName"
      }
    } else {
      error "cannot locate package binary file: $testBinaryFileName"
    }
  }

  #############################################################################
  #******************************* TEST STARTUP *******************************
  #############################################################################

  #
  # NOTE: First, setup the script variables associated with the package tests.
  #
  setupTestVariables

  #
  # NOTE: Next, save the package test path for later use.
  #
  if {![info exists packageTestPath]} then {
    set packageTestPath [fileNormalize [file dirname [info script]] true]
  }

  #
  # NOTE: Finally, if enabled, start the package tests now.
  #
  if {$startTests} then {
    runPackageTests $packageTestPath
  }
}

Added packages/tcl/8.4/win64-x64/Garuda1.0/Tests/all.tcl.asc version [80cc25c4d2].



















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository

iQIcBAABCAAGBQJZ1TD+AAoJEFAslq9JXcLZzIUP/A3KvIUUMPmRXZVLtrGn9Vc0
/nm/dvwFZnFK0GRkzxzpSnMtoCQp+tHsBDBhB/0QCbigh62K3aO1jNW6FTYuI7kl
qxJ4kNJ69JQr2r+z1sxqP5fT0H6sIYEzLMwVXz/HYXlFf4dGUAwkV47x/GxIFjOh
FwcIJnJc/WDc9easn5IAm1b5CE+rM2tjz4AQyvDf2H7rKPLAIm8KyG7WF68sc0OB
M+BBtcNVnN32fvz2PsdQVy+8MOgPCSVgaiz4rAL37TKz/Shp4Ul1X3avDqdUAOEH
8vR7NLLO1zPyy2DHLlXveynMZCBmW2wwSLHO2RY5GVYv604DPwyD+yhTVpfV+qk4
tdLZ4MqVzPptZlYc1IboG361/2KNES76XzO4LG0T4jEOyM+t9srMqACvoSzZXnbs
3y5LJSz5GcAMTFO0bC6FfVirTJw5YdjqZYfRgrjweTLa/T9DYJpgJiOXSC3/ELSM
yQXCLMhxu8bST7SLhkd5y2Mp1izxKsfBEGVICjFWTd9mbrMx81Rpz3Wyt5xYxE5g
tqDJxJcpzOJ0AXrfeh8vqZM2PA+nnCCuNqtMbNBAYIr8sJl7w/c9qPkfz/rrJaLi
1IZurjb+Y4+05ywl1WuoYjgNk0RmDCI1Xr8mLotujgBJAZJsB1mGE/owNkH+oQYE
VUQOnPGlesZ5iJIm1TSG
=Ngih
-----END PGP SIGNATURE-----

Added packages/tcl/8.4/win64-x64/Garuda1.0/dotnet.tcl version [d395115d4c].











































































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
###############################################################################
#
# dotnet.tcl -- Eagle Package for Tcl (Garuda)
#
# Extensible Adaptable Generalized Logic Engine (Eagle)
# Package Loading Helper File (Secondary)
#
# Copyright (c) 2007-2012 by Joe Mistachkin.  All rights reserved.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: $
#
###############################################################################

#
# NOTE: This script file uses features that are only present in Tcl 8.4 or
#       higher (e.g. the "eq" operator for [expr], etc).
#
if {![package vsatisfies [package provide Tcl] 8.4]} then {
  error "need Tcl 8.4 or higher"
}

#
# NOTE: This script file uses features that are not available or not needed
#       in Eagle (e.g. the "http" and "tls" packages, etc).
#
if {[catch {package present Eagle}] == 0} then {
  error "need native Tcl"
}

###############################################################################

namespace eval ::Garuda {
  #############################################################################
  #**************************** SHARED PROCEDURES *****************************
  #############################################################################

  #
  # NOTE: Also defined in and used by "helper.tcl".
  #
  proc fileNormalize { path {force false} } {
    variable noNormalize

    if {$force || !$noNormalize} then {
      return [file normalize $path]
    }

    return $path
  }

  #############################################################################
  #********************* PACKAGE VARIABLE SETUP PROCEDURE *********************
  #############################################################################

  proc setupDotnetVariables { directory } {
    ###########################################################################
    #************* NATIVE PACKAGE GENERAL CONFIGURATION VARIABLES *************
    ###########################################################################

    #
    # NOTE: For this package, the CLR is not started (by default).  Later,
    #       the [garuda clrstart] sub-command can be used to start the CLR.
    #
    variable startClr; # DEFAULT: false

    if {![info exists startClr]} then {
      set startClr false
    }

    #
    # NOTE: For this package, the bridge is not built (by default).  Later,
    #       the [garuda startup] sub-command can be used to build the bridge.
    #
    variable startBridge; # DEFAULT: false

    if {![info exists startBridge]} then {
      set startBridge false
    }
  }

  #############################################################################
  #***************************** PACKAGE STARTUP ******************************
  #############################################################################

  #
  # NOTE: Next, save the package path for later use.
  #
  variable packagePath

  if {![info exists packagePath]} then {
    set packagePath [fileNormalize [file dirname [info script]] true]
  }

  #
  # NOTE: Next, setup the script variables associated with this package.
  #
  setupDotnetVariables $packagePath

  #
  # NOTE: Now that the startup parameters have been overridden, call into
  #       the normal package loading script.
  #
  uplevel 1 [list source [file join $packagePath helper.tcl]]
}

Added packages/tcl/8.4/win64-x64/Garuda1.0/dotnet.tcl.asc version [cc25f1d1ad].



















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository

iQIcBAABCAAGBQJZ1TEDAAoJEFAslq9JXcLZJYUP/RxlIfDTvOaiXHV0iyWSIi4D
EbjUKw00YCsgGhyUytY86vlmXlxF/JLmvi/Jfm7pyb77x5LNJ6zGmwQEnPxuF0s2
lLK+OJSMwkxq6uz15omISe8ooiK/6hoqBrK4eCbX1J9lEq6HnYorf3AmOiKqmU3m
Bqh0hFv7001JcfuXfgDYN4fbVsg962A5MKx+3inuQcOF6BbGxmACxmfEqkYglwYq
zmvKkGqUntRB/p8JHQs7jALZ8ETxiVEL//h4JS6q45vBOf61hoWxIE7BgH1Lf+oY
wZAF5wssMlWpa2cI2P9qYjtsPt9VrzfPdPPoI1Si0CXdWGQEG5E0qFE8MH7aeFBu
Arnhergw8kaZkrXQ9p6kBW2vtCkPkRzoftJLCv5SwhlfW2GVxAUEw2OFQnos5gox
+3Br14JAQz6QzKWMiZs5Z2fgB6PFtJ9YwVZytN4Wh6zZq/yvWEhZNAq3bPa9paHt
N76I6iX0YSPWXVs/hXnptVSmFin9pu5ATDEJdoA31RGszo7Hmv9j9LFASdFR7DJ2
2wBDR1rOux2iB7vjU46W55aU4Xq/5wW1ZOmhli/tNbv2kz8FV5rBu0REntwjZFuq
S5jX/+gZXRH43VY7LGEAEOdgL32+3iAOmPUhoGG4aSPyJzkffPBdsl0IBNp/odDY
cuF2b2ik8McOU9waVqrw
=Ocbs
-----END PGP SIGNATURE-----

Added packages/tcl/8.4/win64-x64/Garuda1.0/helper.tcl version [c4d68d1e79].




























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
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
899
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
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
###############################################################################
#
# helper.tcl -- Eagle Package for Tcl (Garuda)
#
# Extensible Adaptable Generalized Logic Engine (Eagle)
# Package Loading Helper File (Primary)
#
# Copyright (c) 2007-2012 by Joe Mistachkin.  All rights reserved.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: $
#
###############################################################################

#
# NOTE: This script file uses features that are only present in Tcl 8.4 or
#       higher (e.g. the "eq" operator for [expr], etc).
#
if {![package vsatisfies [package provide Tcl] 8.4]} then {
  error "need Tcl 8.4 or higher"
}

#
# NOTE: This script file uses features that are not available or not needed
#       in Eagle (e.g. the "http" and "tls" packages, etc).
#
if {[catch {package present Eagle}] == 0} then {
  error "need native Tcl"
}

###############################################################################

namespace eval ::Garuda {
  #############################################################################
  #**************************** SHARED PROCEDURES *****************************
  #############################################################################

  proc noLog { string } {
    #
    # NOTE: Do nothing.  This will end up returning success to the native code
    #       that uses the configured log command.  Returning success from the
    #       configured log command means "yes, please log this to the attached
    #       debugger (and/or the system debugger) as well".  Returning an error
    #       from the configured log command will prevent this behavior.  Other
    #       than that, returning an error from the configured log command is
    #       completely harmless.
    #
  }

  #
  # NOTE: Also defined in and used by "all.tcl".
  #
  proc lappendUnique { varName args } {
    upvar 1 $varName list

    foreach arg $args {
      if {[lsearch -exact $list $arg] == -1} then {
        lappend list $arg
      }
    }
  }

  #
  # NOTE: Also defined in and used by "all.tcl".
  #
  proc maybeFullName { command } {
    set which [namespace which $command]

    if {[string length $which] > 0} then {
      return $which
    }

    return $command
  }

  #
  # NOTE: Also defined in and used by "dotnet.tcl".
  #
  proc fileNormalize { path {force false} } {
    variable noNormalize

    if {$force || !$noNormalize} then {
      return [file normalize $path]
    }

    return $path
  }

  #
  # NOTE: Also defined in and used by "all.tcl".
  #
  proc isValidDirectory { path } {
    variable logCommand
    variable verbose

    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level -1] 0]]

        eval $logCommand [list \
            "$caller: Checking for directory \"$path\" from \"[pwd]\"..."]
      }
    }

    #
    # NOTE: For now, just make sure the path refers to an existing directory.
    #
    return [expr {[string length $path] > 0 && [file exists $path] && \
        [file isdirectory $path]}]
  }

  #
  # NOTE: Also defined in and used by "all.tcl".
  #
  proc isValidFile { path } {
    variable logCommand
    variable verbose

    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level -1] 0]]

        eval $logCommand [list \
            "$caller: Checking for file \"$path\" from \"[pwd]\"..."]
      }
    }

    #
    # NOTE: For now, just make sure the path refers to an existing file.
    #
    return [expr {[string length $path] > 0 && [file exists $path] && \
        [file isfile $path]}]
  }

  #############################################################################
  #**************************** UTILITY PROCEDURES ****************************
  #############################################################################

  proc isLoaded { fileName {varName ""} } {
    variable logCommand
    variable verbose

    #
    # NOTE: If requested by the caller, give them access to all loaded package
    #       entries that we may find.
    #
    if {[string length $varName] > 0} then {
      upvar 1 $varName loaded
    }

    #
    # NOTE: In Tcl 8.5 and higher, the [lsearch -exact -index] could be used
    #       here instead of this search loop; however, this package needs to
    #       work with Tcl 8.4 and higher.
    #
    foreach loaded [info loaded] {
      #
      # HACK: Exact matching is being used here.  Is this reliable?
      #
      if {[lindex $loaded 0] eq $fileName} then {
        if {$verbose} then {
          catch {
            set caller [maybeFullName [lindex [info level 0] 0]]

            eval $logCommand [list \
                "$caller: Package binary file \"$fileName\" is loaded."]
          }
        }

        return true
      }
    }

    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level 0] 0]]

        eval $logCommand [list \
            "$caller: Package binary file \"$fileName\" is not loaded."]
      }
    }

    return false
  }

  proc getWindowsDirectory {} {
    global env

    if {[info exists env(SystemRoot)]} then {
      return [fileNormalize $env(SystemRoot) true]
    } elseif {[info exists env(WinDir)]} then {
      return [fileNormalize $env(WinDir) true]
    }

    return ""
  }

  proc getFrameworkDirectory { version } {
    set directory [getWindowsDirectory]

    if {[string length $directory] > 0} then {
      return [file join $directory Microsoft.NET Framework \
          v[string trimleft $version v]]
    }

    return ""
  }

  proc checkFrameworkDirectory { version } {
    set directory [getFrameworkDirectory $version]

    if {[string length $directory] > 0 && \
        [isValidDirectory $directory]} then {
      return true
    }

    return false
  }

  proc readFile { fileName } {
    set channel [open $fileName RDONLY]
    fconfigure $channel -encoding binary -translation binary
    set result [read $channel]
    close $channel
    return $result
  }

  proc getClrVersion { fileName } {
    #
    # NOTE: This procedure may not work properly within a safe interpreter;
    #       therefore, handle that case specially.
    #
    if {![interp issafe] && [isValidFile $fileName]} then {
      #
      # NOTE: The string "ClrVersion\0", encoded in UCS-2, represented as
      #       byte values.
      #
      append header \x43\x00\x6C\x00\x72\x00\x56\x00\x65\x00\x72
      append header \x00\x73\x00\x69\x00\x6F\x00\x6E\x00\x00\x00

      #
      # NOTE: Read all the data from the package binary file.
      #
      set data [readFile $fileName]

      #
      # NOTE: Search for the header string within the binary data.
      #
      set index(0) [string first $header $data]

      #
      # NOTE: No header string, return nothing.
      #
      if {$index(0) == -1} then {
        return ""
      }

      #
      # NOTE: Advance the first index to just beyond the header.
      #
      incr index(0) [string length $header]

      #
      # NOTE: Search for the following NUL character, encoded in UCS-2,
      #       represented as byte values.  Due to how the characters are
      #       encoded, this search also includes the trailing zero byte
      #       from the previous character.
      #
      set index(1) [string first \x00\x00\x00 $data $index(0)]

      #
      # NOTE: No following NUL character, return nothing.
      #
      if {$index(1) == -1} then {
        return ""
      }

      #
      # NOTE: Grab the CLR version number embedded in the file data just
      #       after the header.
      #
      return [encoding convertfrom unicode [string range $data $index(0) \
          $index(1)]]
    }

    #
    # NOTE: This is a safe interpreter, for now just skip trying to read
    #       from the package binary file and return nothing.
    #
    return ""
  }

  #
  # WARNING: Other than appending to the configured log file, if any, this
  #          procedure is absolutely forbidden from having any side effects.
  #
  proc shouldUseMinimumClr { fileName {default true} } {
    global env
    variable clrVersions
    variable logCommand
    variable useMinimumClr
    variable verbose

    #
    # NOTE: The package has been configured to use the minimum supported CLR
    #       version; therefore, return true.
    #
    if {[info exists useMinimumClr] && $useMinimumClr} then {
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using minimum CLR version (variable)..."]
        }
      }

      return true
    }

    #
    # NOTE: The environment has been configured to use the minimum supported
    #       CLR version; therefore, return true.
    #
    if {[info exists env(UseMinimumClr)]} then {
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using minimum CLR version (environment)..."]
        }
      }

      return true
    }

    #
    # NOTE: The latest supported version of the CLR is not installed on this
    #       machine; therefore, return true.
    #
    if {![checkFrameworkDirectory [lindex $clrVersions end]]} then {
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using minimum CLR version (missing)..."]
        }
      }

      return true
    }

    #
    # NOTE: Unless forbidden from doing so, check the version of the CLR that
    #       this package binary was compiled for (i.e. the CLR version is
    #
    if {![info exists env(NoClrVersion)]} then {
      set version [getClrVersion $fileName]

      #
      # NOTE: The CLR version was not queried from the package binary, return
      #       the specified default result.
      #
      if {[string length $version] == 0} then {
        if {$verbose} then {
          catch {
            set caller [maybeFullName [lindex [info level 0] 0]]

            if {$default} then {
              eval $logCommand [list \
                  "$caller: Using minimum CLR version (default)..."]
            } else {
              eval $logCommand [list \
                  "$caller: Using latest CLR version (default)..."]
            }
          }
        }

        return $default
      }

      #
      # NOTE: The CLR version queried from the package binary is the minimum
      #       supported; therefore, return true.
      #
      if {$version eq [lindex $clrVersions 0]} then {
        if {$verbose} then {
          catch {
            set caller [maybeFullName [lindex [info level 0] 0]]

            eval $logCommand [list \
                "$caller: Using minimum CLR version (assembly)..."]
          }
        }

        return true
      }
    }

    #
    # NOTE: Ok, use the latest supported version of the CLR.
    #
    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level 0] 0]]

        eval $logCommand [list \
            "$caller: Using latest CLR version..."]
      }
    }

    return false
  }

  #
  # WARNING: Other than appending to the configured log file, if any, this
  #          procedure is absolutely forbidden from having side effects.
  #
  proc shouldUseIsolation {} {
    global env
    variable logCommand
    variable useIsolation
    variable verbose

    #
    # NOTE: The package has been configured to use interpreter isolation;
    #       therefore, return true.
    #
    if {[info exists useIsolation] && $useIsolation} then {
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using interpreter isolation (variable)..."]
        }
      }

      return true
    }

    #
    # NOTE: The environment has been configured to use interpreter isolation;
    #       therefore, return true.
    #
    if {[info exists env(UseIsolation)]} then {
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using interpreter isolation (environment)..."]
        }
      }

      return true
    }

    #
    # NOTE: Ok, disable interpreter isolation.
    #
    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level 0] 0]]

        eval $logCommand [list \
            "$caller: Not using interpreter isolation..."]
      }
    }

    return false
  }

  #
  # WARNING: Other than appending to the configured log file, if any, this
  #          procedure is absolutely forbidden from having side effects.
  #
  proc shouldUseSafeInterp {} {
    global env
    variable logCommand
    variable useSafeInterp
    variable verbose

    #
    # NOTE: The package has been configured to use a "safe" interpreter;
    #       therefore, return true.
    #
    if {[info exists useSafeInterp] && $useSafeInterp} then {
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using a \"safe\" interpreter (variable)..."]
        }
      }

      return true
    }

    #
    # NOTE: The environment has been configured to use a "safe" interpreter;
    #       therefore, return true.
    #
    if {[info exists env(UseSafeInterp)]} then {
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using a \"safe\" interpreter (environment)..."]
        }
      }

      return true
    }

    #
    # NOTE: Ok, disable "safe" interpreter use.
    #
    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level 0] 0]]

        eval $logCommand [list \
            "$caller: Not using a \"safe\" interpreter..."]
      }
    }

    return false
  }

  proc getEnvironmentPathList { varNames varSuffixes } {
    global env

    set result [list]

    #
    # NOTE: Check for a valid file or directory name in the values of each
    #       environment variable name specified by the caller.  If so, add
    #       it to the result list.
    #
    foreach varName $varNames {
      #
      # NOTE: Check each of the environment variable name suffixes specified
      #       by the caller prior to trying the environment variable name by
      #       itself.
      #
      foreach varSuffix $varSuffixes {
        set newVarName ${varName}${varSuffix}

        if {[info exists env($newVarName)]} then {
          set path [string trim $env($newVarName)]

          if {[isValidDirectory $path] || [isValidFile $path]} then {
            lappend result $path
          }
        }
      }

      if {[info exists env($varName)]} then {
        set path [string trim $env($varName)]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }
      }
    }

    return $result
  }

  proc getRegistryPathList { rootKeyName valueName } {
    set result [list]

    catch {
      package require registry; # NOTE: Tcl for Windows only.

      foreach keyName [registry keys $rootKeyName] {
        set subKeyName $rootKeyName\\$keyName

        if {[catch {string trim [registry get \
                $subKeyName $valueName]} path] == 0} then {
          if {[isValidDirectory $path] || [isValidFile $path]} then {
            lappend result $path
          }
        }
      }
    }

    return $result
  }

  proc getLibraryPathList {} {
    #
    # NOTE: Grab the list of volumes mounted on the local machine.
    #
    set volumes [file volumes]

    #
    # NOTE: If there are no volumes, the search loop in this procedure will
    #       not work correctly; therefore, just return an empty list in that
    #       case.
    #
    if {[llength $volumes] == 0} then {
      return [list]
    }

    #
    # TODO: Start out with an empty list of candidate paths.  Then, use the
    #       Tcl core script library path as the basis for searching for the
    #       Eagle CLR assembly directory.  In the future, additional script
    #       library paths may need to be added here.
    #
    set result [list]

    foreach directory [list [info library]] {
      #
      # NOTE: The directory name cannot be an empty string.  In addition,
      #       it cannot be the root of any volume, because that condition
      #       is used to mark the end of the search; however, within the
      #       loop body itself, the internal calls to [file dirname] MAY
      #       refer to the root of a volume (i.e. when joining candidate
      #       directory names with it).
      #
      while {[string length $directory] > 0 && \
          [lsearch -exact $volumes $directory] == -1} {
        set path [file join $directory Eagle bin]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }

        set path [file join $directory bin]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }

        set path [file join $directory Eagle]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }

        set path [file join [file dirname $directory] Eagle bin]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }

        set path [file join [file dirname $directory] bin]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }

        set path [file join [file dirname $directory] Eagle]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }

        set directory [file dirname $directory]
      }
    }

    return $result
  }

  proc getRelativePathList { directories configurations } {
    set result [list]

    foreach directory $directories {
      foreach configuration $configurations {
        set path [file join $directory $configuration Eagle bin]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }

        set path [file join $directory $configuration bin]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }

        set path [file join $directory $configuration Eagle]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }

        set path [file join $directory $configuration]

        if {[isValidDirectory $path] || [isValidFile $path]} then {
          lappend result $path
        }
      }
    }

    return $result
  }

  proc probeAssemblyFile { directory configuration fileName } {
    variable assemblyBaseName
    variable packageBinaryFileName

    set path $directory; # maybe it is really a file?

    if {[isValidFile $path]} then {
      return $path
    }

    set clrPath [expr {
      [shouldUseMinimumClr $packageBinaryFileName] ? "CLRv2" : "CLRv4"
    }]

    if {[string length $configuration] > 0} then {
      set path [file join $directory $assemblyBaseName bin \
          $configuration bin $clrPath $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory $assemblyBaseName bin \
          $configuration bin $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory bin $configuration bin \
          $clrPath $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory bin $configuration bin \
          $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory $assemblyBaseName bin \
          $configuration $clrPath $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory $assemblyBaseName bin \
          $configuration $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory bin $configuration \
          $clrPath $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory bin $configuration \
          $fileName]

      if {[isValidFile $path]} then {
        return $path
      }
    } else {
      set path [file join $directory $assemblyBaseName bin \
          $clrPath $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory $assemblyBaseName bin \
          $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory bin $clrPath $fileName]

      if {[isValidFile $path]} then {
        return $path
      }

      set path [file join $directory bin $fileName]

      if {[isValidFile $path]} then {
        return $path
      }
    }

    return ""
  }

  proc findAssemblyFile { directories configurations fileNames } {
    foreach directory $directories {
      foreach configuration $configurations {
        foreach fileName $fileNames {
          set path [probeAssemblyFile $directory $configuration $fileName]

          if {[isValidFile $path]} then {
            return $path
          }
        }
      }
    }

    return ""
  }

  #############################################################################
  #************************ PACKAGE HELPER PROCEDURES *************************
  #############################################################################

  proc haveEagle { {varName ""} } {
    #
    # NOTE: Attempt to determine if Eagle has been loaded successfully and is
    #       currently available for use.  First, check that there is a global
    #       command named "eagle".  Second, make sure we can use that command
    #       to evaluate a trivial Eagle script that fetches the name of the
    #       script engine itself from the Eagle interpreter.  Finally, compare
    #       that result with "eagle" to make sure it is really Eagle.
    #
    if {[llength [info commands ::eagle]] > 0 && \
        [catch {::eagle {set ::tcl_platform(engine)}} engine] == 0 && \
        [string equal -nocase $engine eagle]} then {
      #
      # NOTE: Ok, it looks like Eagle is loaded and ready for use.  If the
      #       caller wants the patch level, use the specified variable name
      #       to store it in the context of the caller.
      #
      if {[string length $varName] > 0} then {
        upvar 1 $varName version
      }

      #
      # NOTE: Fetch the full patch level of the Eagle script engine.
      #
      if {[catch {::eagle {set ::eagle_platform(patchLevel)}} \
              version] == 0} then {
        #
        # NOTE: Finally, verify that the result looks like a proper patch
        #       level using a suitable regular expression.
        #
        if {[regexp -- {^\d+\.\d+\.\d+\.\d+$} $version]} then {
          return true
        }
      }
    }

    return false
  }

  #############################################################################
  #********************* PACKAGE VARIABLE SETUP PROCEDURE *********************
  #############################################################################

  proc setupHelperVariables { directory } {
    ###########################################################################
    #*********** NATIVE PACKAGE DIAGNOSTIC CONFIGURATION VARIABLES ************
    ###########################################################################

    #
    # NOTE: Display diagnostic messages while starting up this package?  This
    #       is used by the code in the CLR assembly manager contained in this
    #       package.  This is also used by the package test suite.
    #
    variable verbose; # DEFAULT: false

    if {![info exists verbose]} then {
      set verbose false
    }

    #
    # NOTE: The Tcl command used to log warnings, errors, and other messages
    #       generated by the package.  This is used by the code in the CLR
    #       assembly manager contained in this package.  This is also used by
    #       the package test suite.
    #
    variable logCommand; # DEFAULT: [namespace current]::noLog

    if {![info exists logCommand]} then {
      set logCommand [namespace current]::noLog
    }

    #
    # NOTE: When this is non-zero, the [file normalize] sub-command will not
    #       be used on the assembly path.  This is necessary in some special
    #       environments due to a bug in Tcl where it will resolve junctions
    #       as part of the path normalization process.
    #
    variable noNormalize; # DEFAULT: false

    if {![info exists noNormalize]} then {
      set noNormalize false
    }

    ###########################################################################
    #********************* NATIVE PACKAGE NAME VARIABLES **********************
    ###########################################################################

    #
    # NOTE: The name of the package we will provide to Tcl.
    #
    variable packageName; # DEFAULT: Garuda

    if {![info exists packageName]} then {
      set packageName [lindex [split [string trim [namespace current] :] :] 0]
    }

    #
    # NOTE: The name of the dynamic link library containing the native code for
    #       this package.
    #
    variable packageBinaryFileNameOnly; # DEFAULT: Garuda.dll

    if {![info exists packageBinaryFileNameOnly]} then {
      set packageBinaryFileNameOnly $packageName[info sharedlibextension]
    }

    #
    # NOTE: The fully qualified file name for the package binary.
    #
    variable packageBinaryFileName; # DEFAULT: ${directory}/Garuda.dll

    if {![info exists packageBinaryFileName]} then {
      set packageBinaryFileName [fileNormalize [file join $directory \
          $packageBinaryFileNameOnly] true]
    }

    ###########################################################################
    #************* NATIVE PACKAGE GENERAL CONFIGURATION VARIABLES *************
    ###########################################################################

    #
    # NOTE: The fully qualified path and file name for the Eagle CLR assembly
    #       to be loaded.  This is used by the code in the CLR assembly manager
    #       contained in this package.
    #
    variable assemblyPath; # DEFAULT: <unset>

    #
    # NOTE: The fully qualified type name of the CLR method(s) to execute
    #       within the Eagle CLR assembly.  This is used by the code in the
    #       CLR assembly manager contained in this package.
    #
    variable typeName; # DEFAULT: Eagle._Components.Public.NativePackage

    if {![info exists typeName]} then {
      set typeName Eagle._Components.Public.NativePackage
    }

    #
    # NOTE: The name of the CLR method to execute when starting up the bridge
    #       between Eagle and Tcl.  This is used by the code in the CLR
    #       assembly manager contained in this package.
    #
    variable startupMethodName; # DEFAULT: Startup

    if {![info exists startupMethodName]} then {
      set startupMethodName Startup
    }

    #
    # NOTE: The name of the CLR method to execute when issuing control
    #       directives to the bridge between Eagle and Tcl.  This is used by
    #       the code in the CLR assembly manager contained in this package.
    #
    variable controlMethodName; # DEFAULT: Control

    if {![info exists controlMethodName]} then {
      set controlMethodName Control
    }

    #
    # NOTE: The name of the managed method to execute when detaching a specific
    #       Tcl interpreter from the bridge between Eagle and Tcl.  This is
    #       used by the code in the CLR assembly manager contained in this
    #       package.
    #
    variable detachMethodName; # DEFAULT: Detach

    if {![info exists detachMethodName]} then {
      set detachMethodName Detach
    }

    #
    # NOTE: The name of the managed method to execute when completely shutting
    #       down the bridge between Eagle and Tcl.  This is used by the code in
    #       the CLR assembly manager contained in this package.
    #
    variable shutdownMethodName; # DEFAULT: Shutdown

    if {![info exists shutdownMethodName]} then {
      set shutdownMethodName Shutdown
    }

    #
    # NOTE: The user arguments to pass to all of the managed methods.  If this
    #       value is specified, it MUST be a well-formed Tcl list.  This is
    #       used by the code in the CLR assembly manager contained in this
    #       package.
    #
    variable methodArguments; # DEFAULT: NONE

    if {![info exists methodArguments]} then {
      set methodArguments [list]
    }

    #
    # NOTE: The extra method flags to use when invoking the CLR methods.  Refer
    #       to the MethodFlags enumeration for full details.  This is used by
    #       the code in the CLR assembly manager contained in this package.  An
    #       example of a useful value here is 0x40 (i.e. METHOD_PROTOCOL_V1R2).
    #
    variable methodFlags; # DEFAULT: 0x0

    if {![info exists methodFlags]} then {
      set methodFlags 0x0
    }

    #
    # NOTE: Load the CLR immediately upon loading the package?  This is used
    #       by the code in the CLR assembly manager contained in this package.
    #
    variable loadClr; # DEFAULT: true

    if {![info exists loadClr]} then {
      set loadClr true
    }

    #
    # NOTE: Start the CLR immediately upon loading the package?  This is used
    #       by the code in the CLR assembly manager contained in this package.
    #
    variable startClr; # DEFAULT: true

    if {![info exists startClr]} then {
      set startClr true
    }

    #
    # NOTE: Start the bridge between Eagle and Tcl immediately upon loading
    #       the package?  This is used by the code in the CLR assembly manager
    #       contained in this package.
    #
    variable startBridge; # DEFAULT: true

    if {![info exists startBridge]} then {
      set startBridge true
    }

    #
    # NOTE: Attempt to stop and release the CLR when unloading the package?
    #       This is used by the code in the CLR assembly manager contained
    #       in this package.
    #
    variable stopClr; # DEFAULT: true

    if {![info exists stopClr]} then {
      set stopClr true
    }

    ###########################################################################
    #*************** NATIVE PACKAGE CLR CONFIGURATION VARIABLES ***************
    ###########################################################################

    #
    # NOTE: This is the list of CLR versions supported by this package.  In
    #       the future, this list may need to be updated.
    #
    variable clrVersions; # DEFAULT: "v2.0.50727 v4.0.30319"

    if {![info exists clrVersions]} then {
      set clrVersions [list v2.0.50727 v4.0.30319]
    }

    #
    # NOTE: Use the minimum supported version of the CLR?  By default, we want
    #       to load the latest known version of the CLR (e.g. "v4.0.30319").
    #       However, this loading behavior can now be overridden by setting the
    #       environment variable named "UseMinimumClr" [to anything] -OR- by
    #       setting this Tcl variable to non-zero.  In that case, the minimum
    #       supported version of the CLR will be loaded instead (e.g.
    #       "v2.0.50727").  This Tcl variable is primarily used by the compiled
    #       code for this package.
    #
    variable useMinimumClr; # DEFAULT: false

    if {![info exists useMinimumClr]} then {
      set useMinimumClr [shouldUseMinimumClr $packageBinaryFileName]
    } elseif {$verbose} then {
      #
      # HACK: Make sure the setting value ends up in the log file.
      #
      shouldUseMinimumClr $packageBinaryFileName; # NOTE: No side effects.
    }

    ###########################################################################
    #*********** NATIVE PACKAGE INTERPRETER CONFIGURATION VARIABLES ***********
    ###########################################################################

    #
    # NOTE: Use an isolated Eagle interpreter even if the Tcl interpreter that
    #       the package has been loaded into is "unsafe"?
    #
    variable useIsolation; # DEFAULT: false

    if {![info exists useIsolation]} then {
      set useIsolation [shouldUseIsolation]
    } elseif {$verbose} then {
      #
      # HACK: Make sure the setting value ends up in the log file.
      #
      shouldUseIsolation; # NOTE: No side effects.
    }

    #
    # NOTE: Use a "safe" Eagle interpreter even if the Tcl interpreter that the
    #       package has been loaded into is "unsafe"?
    #
    variable useSafeInterp; # DEFAULT: false

    if {![info exists useSafeInterp]} then {
      set useSafeInterp [shouldUseSafeInterp]
    } elseif {$verbose} then {
      #
      # HACK: Make sure the setting value ends up in the log file.
      #
      shouldUseSafeInterp; # NOTE: No side effects.
    }

    ###########################################################################
    #******************** MANAGED ASSEMBLY NAME VARIABLES *********************
    ###########################################################################

    #
    # NOTE: The Eagle build configurations we know about and support.  This
    #       list is used during the CLR assembly search process in the [setup]
    #       procedure (below).
    #
    variable assemblyConfigurations; # DEFAULT: {Debug Release ""}

    if {![info exists assemblyConfigurations]} then {
      set assemblyConfigurations [list]

      #
      # HACK: When running under the auspices of the Eagle test suite, select
      #       the matching build configuration and suffix, if any.
      #
      set assemblyConfiguration ""

      if {[info exists ::test_flags(-configuration)] && \
          [string length $::test_flags(-configuration)] > 0} then {
        append assemblyConfiguration $::test_flags(-configuration)

        if {[info exists ::test_flags(-suffix)] && \
            [string length $::test_flags(-suffix)] > 0} then {
          append assemblyConfiguration  $::test_flags(-suffix)
        }
      }

      if {[string length $assemblyConfiguration] > 0} then {
        lappend assemblyConfigurations $assemblyConfiguration
      }

      #
      # NOTE: Remove the temporary assembly configuration variable.
      #
      unset assemblyConfiguration

      #
      # NOTE: If there is a build suffix, use it to enhance the default list
      #       of configurations.
      #
      if {[info exists ::test_flags(-suffix)] && \
          [string length $::test_flags(-suffix)] > 0} then {
        #
        # NOTE: First, add each of the default configurations with the build
        #       suffix appended to them.
        #
        lappend assemblyConfigurations Debug${::test_flags(-suffix)}
        lappend assemblyConfigurations Release${::test_flags(-suffix)}
      }

      #
      # NOTE: Finally, always add the default build configurations last.
      #
      lappend assemblyConfigurations Debug Release ""
    }

    #
    # NOTE: The possible file names for the Eagle CLR assembly, where X is the
    #       major version of the CLR.
    #
    variable assemblyFileNames; # DEFAULT: "Eagle_CLRvX.dll Eagle.dll"

    if {![info exists assemblyFileNames]} then {
      set assemblyFileNames [list]

      #
      # NOTE: If the minimum supported version of the CLR has been (or will be)
      #       loaded, add the decorated Eagle assembly file name specific to
      #       CLR version 2.0.50727; otherise, add the decorated Eagle assembly
      #       file name specific to CLR version 4.0.30319.
      #
      if {[shouldUseMinimumClr $packageBinaryFileName]} then {
        #
        # NOTE: Either we cannot or should not use the latest known version of
        #       the CLR; therefore, use the minimum supported version.  In this
        #       situation, the Eagle assembly specific to the v2 CLR will be
        #       checked first.
        #
        lappend assemblyFileNames Eagle_CLRv2.dll
      } else {
        #
        # NOTE: The latest known version of the CLR is available for use and we
        #       have not been prevented from using it.  In this situation, the
        #       Eagle assembly specific to the v4 CLR will be checked first.
        #
        # TODO: Should we provide the ability to fallback to the v2 CLR version
        #       of the assembly here (i.e. should "Eagle_CLRv2.dll" be added to
        #       this list right after "Eagle_CLRv4.dll")?  This is always legal
        #       because the v4 CLR can load v2 CLR assemblies.
        #
        lappend assemblyFileNames Eagle_CLRv4.dll
      }

      #
      # NOTE: Fallback to the generic assembly file name that is CLR version
      #       neutral (i.e. the version of the CLR it refers to is unknown).
      #
      lappend assemblyFileNames Eagle.dll
    }

    #
    # NOTE: The base name for the Eagle CLR assembly.
    #
    variable assemblyBaseName; # DEFAULT: Eagle

    if {![info exists assemblyBaseName]} then {
      set assemblyBaseName [file rootname [lindex $assemblyFileNames end]]
    }

    ###########################################################################
    #******************* MANAGED ASSEMBLY SEARCH VARIABLES ********************
    ###########################################################################

    #
    # NOTE: Use the configured environment variables when searching for the
    #       Eagle CLR assembly?
    #
    variable useEnvironment; # DEFAULT: true

    if {![info exists useEnvironment]} then {
      set useEnvironment true
    }

    #
    # NOTE: The environment variable names to check when attempting to find the
    #       Eagle root directory.  This list is used during the assembly search
    #       process from within the [setupAndLoad] procedure.
    #
    variable envVars; # DEFAULT: "Eagle_Dll Eagle EagleLkg Lkg"

    if {![info exists envVars]} then {
      set envVars [list Eagle_Dll Eagle EagleLkg Lkg]
    }

    #
    # NOTE: The strings to append to the environment variable names listed
    #       above when attempting to find the Eagle root directory.  This list
    #       is used during the assembly search process from within the
    #       [setupAndLoad] procedure.
    #
    variable envVarSuffixes; # DEFAULT: "Temp Build"

    if {![info exists envVarSuffixes]} then {
      set envVarSuffixes [list Temp Build]
    }

    #
    # NOTE: Use the various relative paths based on the location of this script
    #       file?  This is primarily for use during development, when the Eagle
    #       CLR assembly will be in the build output directory.
    #
    variable useRelativePath; # DEFAULT: true

    if {![info exists useRelativePath]} then {
      set useRelativePath true
    }

    #
    # NOTE: Use the configured Windows registry keys when searching for the
    #       Eagle CLR assembly?
    #
    variable useRegistry; # DEFAULT: true

    if {![info exists useRegistry]} then {
      set useRegistry true
    }

    #
    # NOTE: Use the various Tcl script library directories when searching for
    #       the Eagle CLR assembly?
    #
    variable useLibrary; # DEFAULT: true

    if {![info exists useLibrary]} then {
      set useLibrary true
    }

    #
    # NOTE: The registry key where all the versions of Eagle installed on this
    #       machine (via the setup) can be found.
    #
    variable rootRegistryKeyName; # DEFAULT: HKEY_LOCAL_MACHINE\Software\Eagle

    if {![info exists rootRegistryKeyName]} then {
      set rootRegistryKeyName HKEY_LOCAL_MACHINE\\Software\\Eagle
    }
  }

  #############################################################################
  #************************ PACKAGE STARTUP PROCEDURE *************************
  #############################################################################

  proc setupAndLoad { directory } {
    variable assemblyConfigurations
    variable assemblyFileNames
    variable assemblyPath
    variable envVars
    variable envVarSuffixes
    variable logCommand
    variable packageBinaryFileName
    variable packageName
    variable rootRegistryKeyName
    variable useEnvironment
    variable useLibrary
    variable useRegistry
    variable useRelativePath
    variable verbose

    if {[info exists assemblyPath]} then {
      #
      # NOTE: The managed assembly path has been pre-configured by an external
      #       script; therefore, just use it verbatim.
      #
      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Using existing assembly path \"$assemblyPath\"..."]
        }
      }
    } else {
      #
      # NOTE: Build the list of directories to search for the managed assembly.
      #
      set directories [list]

      if {$useRelativePath} then {
        eval lappendUnique directories [getRelativePathList [list \
            $directory [file dirname $directory] \
            [file dirname [file dirname $directory]] \
            [file dirname [file dirname [file dirname $directory]]]] \
            $assemblyConfigurations]
      }

      if {$useEnvironment} then {
        eval lappendUnique directories [getEnvironmentPathList \
            $envVars $envVarSuffixes]
      }

      if {$useRegistry} then {
        eval lappendUnique directories [getRegistryPathList \
            $rootRegistryKeyName Path]
      }

      if {$useLibrary} then {
        eval lappendUnique directories [getLibraryPathList]
      }

      if {$verbose} then {
        catch {
          set caller [maybeFullName [lindex [info level 0] 0]]

          eval $logCommand [list \
              "$caller: Final list of directories to search: $directories"]
        }
      }

      #
      # NOTE: Attempt to find the Eagle managed assembly file using the list of
      #       candidate directories.
      #
      set path [findAssemblyFile $directories $assemblyConfigurations \
          $assemblyFileNames]

      if {[isValidFile $path]} then {
        #
        # NOTE: This will end up being used by code (the native code for this
        #       package) that may have a different current working directory;
        #       therefore, make sure to normalize it first.
        #
        set assemblyPath [fileNormalize $path]
      }

      #
      # NOTE: If no managed assembly path could be found, use the default one.
      #       This is very unlikely to result in the package being successfully
      #       loaded.
      #
      if {![info exists assemblyPath] || \
          [string length $assemblyPath] == 0} then {
        #
        # NOTE: Choose the last (default) managed assembly file name residing
        #       in the same directory as the package.  This will end up being
        #       used by code (the native code for this package) that may have
        #       a different current working directory; therefore, make sure to
        #       normalize it first.
        #
        set assemblyPath [fileNormalize [file join $directory [lindex \
            $assemblyFileNames end]]]

        if {$verbose} then {
          catch {
            set caller [maybeFullName [lindex [info level 0] 0]]

            eval $logCommand [list \
                "$caller: Using default assembly path \"$assemblyPath\"..."]
          }
        }
      }
    }

    #
    # NOTE: Attempt to load the dynamic link library for the package now that
    #       the managed assembly path has been set [to something].
    #
    if {$verbose} then {
      catch {
        set caller [maybeFullName [lindex [info level 0] 0]]

        eval $logCommand [list \
            "$caller: Using final assembly path \"$assemblyPath\"..."]
      }
    }

    load $packageBinaryFileName $packageName
  }

  #############################################################################
  #***************************** PACKAGE STARTUP ******************************
  #############################################################################

  #
  # NOTE: First, arrange to have the "haveEagle" helper procedure exported
  #       from this namespace and imported into the global namespace.
  #
  set namespace [namespace current]; namespace export -clear haveEagle
  namespace eval :: [list namespace forget ::${namespace}::*]
  namespace eval :: [list namespace import -force ::${namespace}::haveEagle]

  #
  # NOTE: Next, save the package path for later use.
  #
  variable packagePath

  if {![info exists packagePath]} then {
    set packagePath [fileNormalize [file dirname [info script]] true]
  }

  #
  # NOTE: Next, setup the script variables associated with this package.
  #
  setupHelperVariables $packagePath

  #
  # NOTE: Finally, attempt to setup and load the package right now.
  #
  setupAndLoad $packagePath
}

Added packages/tcl/8.4/win64-x64/Garuda1.0/helper.tcl.asc version [41203a04d6].



















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository

iQIcBAABCAAGBQJZ1TEGAAoJEFAslq9JXcLZdUoQAJr8i/IbFqhZqnP7zTvmTVxC
uRxxv/gaV3JkYYGYgax98zYCkh/q9m7vLt13SgTgI04XFATLbDHCGUI8ttu57iL1
xQoAo+LMZ74en0D3L6ylXdYKj+A+ph/814LGBpMIEX6YNFLRsUNt25f/bQMN6By7
pT8jNXULKtoV90FngsKurjxMynh6fCRlwfYWlgIG3lbbbCZx7IFT/2INJ3f3cfcN
SaoUL8E9Zm8pbOxrvjBOIgDzmoj7e1794ajr+aKeXpQbv7WD4t/Z8YllbB9SWLQ5
ESLDSnV0mZAY/ebtQsMzvqEEDqvlm0TgIuiRpngCPI0YpFpWXfKq4Z0SjorQoB7y
9XSR7JgosiijAqFIN9IGU9KrresKubt4VzMnDGo8SydhjqJbfdlJlICK3Dsi8TiH
XCOgT364voYXe1wumlgYA2Y1VDaQ0RvlJY8jyXdtM2r09dlkzePfI3s1Fn6nbulX
UV8qSaNL/AMP4SiLgk0d+EZNmJv8TBru0vdPiVz137wn0jMF9/K4GONICFstjPlJ
21tybaZ8/n8TLg8bRbOeY85EuyZTcB76/b7zzI07bJWUXxyGareM+aWyEMkoUNgj
sQKb9+AVCquhXbLrAGHCi+6jlc/WsTRQAgAvbi3O0k5B9559WJA/3fM+FIHPm62z
fIUJmnh5vty4V656kBgV
=YpBf
-----END PGP SIGNATURE-----

Added packages/tcl/8.4/win64-x64/Garuda1.0/msvcr100.dll version [50db750522].

cannot compute difference between binary files

Added packages/tcl/8.4/win64-x64/Garuda1.0/msvcr100.dll.asc version [86d17b2814].



















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository

iQIcBAABCAAGBQJZ5/U0AAoJEFAslq9JXcLZRBMQAMTpsMYNu6t9NNn6VBI0sxsv
EvSrdtHTFjm7Gpeog+Xe5Y0il3mLsI4WgG6GXmtd09qcwz1f6AJconrChBA8wwUV
7eL0fRaEquoB3reajeFZFy7tLGl8AESTm0BedeWFgLLQkFdUEnun0iL/RdZJjJY4
4AyjDqSsyCioSymplGUnfNCM60Bkn9F5JwQJmy7ouQWI491jrKC2h20kQLkK+mUo
WalSmF9x0MNOXkDlVWyNE3NJyoBKkU/B9fdA1QDKZyRlE3bId+F0p7pF2NhjN4Q3
NnTfZhQheyshE4k9OFH2e5FSrI61BmXwXABCFD2ScrFv/G+KzcJHkv3saWHrhggX
HF/073SXSL+BMiZ/fnt6IstxGscE6WZOexF2cE0bcsPql/Nk8Tcv3e98MYu7Aqsh
s5j7OVnq+xBArHbPTz/GJXIu/j4IwCCJXRc1G5rEA5yqcWH5wqWstGlI0QBclCKN
K/pavaSnLpS0jMbEI23YXD9Pi6pls8nUVVjk8F3Rr03//HpAJ6jP7lRW4cmxRFwa
FXq2RkqcX0MRjZy+XjaB5tzpf5BO+hIc5H0Yus9GUEzDf2RjNjkXPH1v9IAbBDuJ
B4BJmMQUmsheyHDyX0LFGbg63ilNnrF35gIgEbL4CbMhwBfifXlhVpRG6PLozl90
l7A7s35/KGxB2cG2KBrx
=ZWoB
-----END PGP SIGNATURE-----

Added packages/tcl/8.4/win64-x64/Garuda1.0/pkgIndex.tcl version [ee80fc74ae].

























1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
###############################################################################
#
# pkgIndex.tcl -- Eagle Package for Tcl (Garuda)
#
# Extensible Adaptable Generalized Logic Engine (Eagle)
# Package Index File
#
# Copyright (c) 2007-2012 by Joe Mistachkin.  All rights reserved.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: $
#
###############################################################################

if {![package vsatisfies [package provide Tcl] 8.4]} then {return}
if {[string length [package provide Eagle]] > 0} then {return}

package ifneeded dotnet 1.0 \
    [list source [file join $dir dotnet.tcl]]

package ifneeded Garuda 1.0 \
    [list source [file join $dir helper.tcl]]

Added packages/tcl/8.4/win64-x64/Garuda1.0/pkgIndex.tcl.asc version [976cb1378b].



















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository

iQIcBAABCAAGBQJYHkfNAAoJEFAslq9JXcLZ6QgP/ioarzyTOK9OLkfqhtND/EWa
3DO127WL8Pw5CBgsDvUXShfSYA6jDvNxsp+u63wMr4Snzkr3ZQFoCyf4nnx0+f3H
7chgplksTyPSH5baZXFL9wVq8wGJX73/Kl8C6cTdwqaMXR2AsDODqKlb4w9FG7Qv
1hIo/o7WPyEk8r/ijXKuDY3VKrdb/+TpwtfDObmOHZV5qGUw7WQe2IVon33IPZS1
CDUltRb3pKQhx4qTGKE1rvD0B26uFv0ojjD9y25mOqOfFsqD5uvbbpVdKjGkrRCZ
6VklRHWDn0HKSOyuCqM/XFM7b/SdZu2JeAFFu42KUoXZDIEb6ECwfV9tBDAu//Y/
X1QngifMZxXaKG5QBdpH5MVhUCYWK9WzStis/AoBZjQQtiizEX6M3Hgr94KhNbvB
tjGhst/Ihxz3sphIwTGInNuFXBgSmjxOA4mfcgF8Kvbiw1UoxKkfbiyzmWcNHoOI
WjUg9flnFw3jQzQuip+GDP68WmknJ1AyQK2AEXbKaPdH9GtS1zUrTWzOpwOQ/srV
PMGL89lHSNOQPMvwMpTS3if6hvFOJFPARCGAie3LwkmHnhkE9zyoQw+xcUgvWBNH
xbr5Eg+wmsEgkYK105ZlDPUYK1cz9Y5kGL0QALEFkGlNPII0IyyrjSHdVqXo69az
l0SQeZpafqjvkTHYqaTC
=6kIs
-----END PGP SIGNATURE-----