Index: client/1.0/neutral/pkgd.eagle
==================================================================
--- client/1.0/neutral/pkgd.eagle
+++ client/1.0/neutral/pkgd.eagle
@@ -542,11 +542,13 @@
# configured URI.
#
if {[catch {
#
# NOTE: First, build the actual URI where the Package Signing
- # Keys should be obtained.
+ # Keys should be obtained, performing any applicable
+ # substitutions in the URI prior to using it as the
+ # basis for downloading the Package Signing Keys file.
#
set uri [subst $substUri]
#
# NOTE: Then, in one step, download the file from the package
@@ -1218,11 +1220,13 @@
variable loginCookie
variable loginUri
variable loginUrn
#
- # NOTE: Build the full URI for the login request.
+ # NOTE: Build the full URI for the login request, performing any
+ # applicable substitutions in the URI prior to using it as
+ # the basis for logging into the repository.
#
set uri [subst $loginUri]
#
# NOTE: Reset the old login cookie, if any. Then, issue a new login
@@ -1276,11 +1280,13 @@
if {![info exists loginCookie] || [llength $loginCookie] != 2} then {
error "missing or invalid login cookie"
}
#
- # NOTE: Build the full URI for the logout request.
+ # NOTE: Build the full URI for the logout request, performing any
+ # applicable substitutions in the URI prior to using it as
+ # the basis for logging out of the repository.
#
set authToken [lindex $loginCookie 1]
set uri [subst $logoutUri]
#
@@ -1423,20 +1429,26 @@
variable branchName
variable platformsUri
variable platformsUrn
variable temporaryRootDirectory
+ #
+ # NOTE: Verify that the package language and version are correct.
+ #
+ verifyLanguageAndVersion $language $version isClient
+
set temporaryDirectory [file join \
$temporaryRootDirectory [appendArgs \
pkgd_plat_ [::PackageRepository::getUniqueSuffix]]]
set localFileName [file join $temporaryDirectory manifest.txt]
file mkdir [file dirname $localFileName]
#
# NOTE: First, build the final URI to download from the remote package
- # repository.
+ # repository, performing any applicable substitutions in the URI
+ # prior to using it as the basis for fetching the platform list.
#
set uri [subst $platformsUri]
#
# NOTE: Then, in one step, download the file from the package file
@@ -1470,10 +1482,18 @@
if {[string length $packageName] > 0} then {
set pattern [file join $language $version * $packageName *]
} else {
set pattern [file join $language $version *]
}
+
+ #
+ # NOTE: For package files that are not part of the client package,
+ # put them inside the "packages" sub-directory.
+ #
+ if {!$isClient} then {
+ set pattern [file join packages $pattern]
+ }
foreach line $lines {
if {[string range $line 0 1] eq "F "} then {
set fileName [lindex [split $line " "] 1]
@@ -1556,15 +1576,35 @@
variable baseUri
variable branchName
variable downloadUri
variable downloadUrn
+ #
+ # NOTE: Verify that the package language, version, and platform are
+ # correct.
+ #
+ verifyLanguageAndVersion $language $version isClient
+ verifyPlatform $platform platform
+
#
# NOTE: First, build the full relative file name to download from
# the remote package repository.
#
set fileName [file join $language $version $platform $fileName]
+
+ #
+ # NOTE: For package files that are not part of the client package,
+ # put them inside the "packages" sub-directory.
+ #
+ if {!$isClient} then {
+ set fileName [file join packages $fileName]
+ }
+
+ #
+ # NOTE: Perform any applicable substitutions in the URI prior to
+ # using it as the basis for downloading the package file.
+ #
set uri [subst $downloadUri]
#
# NOTE: Then, in one step, download the file from the package file
# server and write it to the specified local file.
Index: client/1.0/neutral/pkgd.eagle.asc
==================================================================
--- client/1.0/neutral/pkgd.eagle.asc
+++ client/1.0/neutral/pkgd.eagle.asc
@@ -1,18 +1,18 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository
-iQIcBAABCAAGBQJZXVbRAAoJEFAslq9JXcLZbLsQAMFZs0051Kv+nZBDbDRhqHIm
-+zoHA50Grc7EQAmAsI5p7jnk8a5gCy0iToIykdxKAozYcJZP7YDWNvpTzc3GDBNA
-nNIJpZYRAoQB/ZH9WnlCuIFUXttyY+qtyYUJ92P2c8pPCX1xdVCZck1COGLvOU8f
-ZyoUCaYbK+2hHh5GoZMapuJnB7Vf4ahPSXHYCwwadWNmQY464ZfwppzqcuZX+6rj
-KQoR9xfBT6aGkT9cdK5wtIJnW2my5iZTA8Yu3KUQ4TiWmIah3D4NISehQwQa6370
-IomaLeKpusC5+N29TKMvWLoeaJXT72xdgjcKkqesFq4uqLMZDA6OMGq09VP/sNP6
-OQf1FcF6fzqq/nqXZpnMItiwwNZYfuS1PrvNDkxw02QYC0r3kDFb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----END PGP SIGNATURE-----
Index: client/1.0/neutral/pkgd.eagle.harpy
==================================================================
--- client/1.0/neutral/pkgd.eagle.harpy
+++ client/1.0/neutral/pkgd.eagle.harpy
@@ -19,50 +19,50 @@
None
Mistachkin Systems
- 2d19e162-f160-461d-9d92-4bb3f55fc49f
+ 7098aa99-1a6b-4701-bc7f-149bb577d233
SHA512
Script
- 2017-07-05T21:13:55.3203125Z
+ 2017-07-21T21:54:05.1611328Z
-1.00:00:00
0x9559f6017247e3e2
- wfhPEj1BPnAZC3PXCuO1tVOERdgqinobwKh/VSB4t/zdxY9drYmH3tzm63YfHoLnOKA/qVz8PAlw
- S3yov1vVGYCJR05sdYaNOeAkDfZoE/t00Sn3NGlljvEIipkPiK9cRc7d3cH+vi0ZodLs62jSw4o6
- nd6fOWzv/1jXWXKw203kuevPjfgp9N/ytJ9SjYa32rpg8Tuzl2fFfgoKaPvr6iyVDoVUQrjRIQJw
- o+U8M4DHdoXQ9sKJks3ab8+rLjVPsli+ui+ijCiXkK12+6yVCSeVeYQfH5Q5Rg0SuyWqxFfYvDMA
- FovZ8YMOKqRQBu52eYImLnDtWznHWrNpQLz/Rc/sk82v5TWoxakGwE9Ibl14yAfxl4pWdBEfP8Mr
- BljnEvMUlclPzBHpCX5C0XtX0a8A1NyGckqOR0dcB8ZpEFLqvKwKujoBheYOmv3P8R/r2a58+pn3
- MiOZNlX/smQHHo3AEMRBqCyfdB8l3DUb9WvoBcPAeiQIsOik5LN8Vx2EprfeJcPff1DMGoSuTfQa
- 3Qw/o4wsfeopCD2e6gAIYkZlN8Doataz02ejbg4PCNJ71KyuhuoIPUWG4NuyRv7ia2aOxftYz3ep
- zjCtA1x27OnhrrUG+Nfn8AKSkQw+5C2TnpL2ioW5xDw0zXq5R2geW7dDT4gI9XeywXUIDqC7rQNU
- CUk1m674NVFLIHfzFDy6hy3Gwa7qiRpT0MmntZbnUALLtFAF7cGZSG2+kzf1EE0j2BfxZeCppkW6
- lJED7TNidnwrSLVjpj3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CKk
+ 44LntErhm0PPaChZ/p+GX4pceZ1mlUs4TojmOJfJy/Jy63/46VVqBG+kE5wTfLJu2BikTORyiG4K
+ a5DNy/aJL8yyT1J+lD4GwhclWK0hJuhjwnLF19yZIW8zls4AxHxnwbOiUWhr9ngRKft93wkUqFdI
+ wuBSMKkkV4YSs6Rp3xUzUuR1X+o2ylJRNjyNC7nJbEKPxrX+riZknrZs6d+U+tIBQiPVXhpLWiFE
+ BDbzX2ZQ9nRhg+1HiDoB0YyMrgwtBYVzKCFcSACeo1sPIIcSgZ+D0Ua9P+g4CFck1tYF2Y9vVOr9
+ fxboKikiNzaLGHygFq+5n7GBTgQkPh1zc4P6xiJfKWOYNA5x9OQWk0Y/C1BIvvl0ThdPyy1OVV/p
+ AmGl+CpCLXEOTYE9tSagp9+JTam/pRH1/RKm3v4ccvXSl3VGYcDNSDlZ2GjKtgfPiLKBFBIia+Rf
+ VJyrhih7J/smk0uOKbA/R8FnJg+P66c4HKqjMMUNRldFcNTbfwwRuefTtC+rleGe/advyEw=
Index: client/1.0/neutral/pkgd.eagle.harpy.asc
==================================================================
--- client/1.0/neutral/pkgd.eagle.harpy.asc
+++ client/1.0/neutral/pkgd.eagle.harpy.asc
@@ -1,18 +1,18 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository
-iQIcBAABCAAGBQJZXVbSAAoJEFAslq9JXcLZKKMP/2Zxipv35Xi4JAz9gASdYmUN
-dzd7g+gBxIwVUNwa/CjoFLDmzMqfEjsxcJBqJdjSQsXf3927Gu7/fZWLGf7FIv0t
-Qj82coqA6qQY9UfSc0g2yLlNA6wNUHvJkmKe/l3Vfy2V8/TJbFpevz3PwMoZh6mW
-Z2KGGCtTfVMBcDV+E25zOGtQa2vxGFJvvP0F2NQab3LCBPIrzJCQ97snS7E3u61f
-SWeljqmUUTAzEktj/AMWwBpsNEJwt7KzCgwcJ5IuzsUfLVlZIKKAoOyAcpDNX17k
-wDscww9nADu8WVSZzRv4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LM2DVHIR+RGyjBPrNM3EjiknuF0jjSyaIJaC+cOf/QhnXN
+f0CLNC90UoHNI9oKcxsY
+=MWuq
-----END PGP SIGNATURE-----
Index: client/1.0/neutral/pkgu.eagle
==================================================================
--- client/1.0/neutral/pkgu.eagle
+++ client/1.0/neutral/pkgu.eagle
@@ -1001,10 +1001,17 @@
#
proc stagePackageFiles { language version platform fileNames } {
variable checkoutDirectory
variable fossilAddCommand
+ ::PackageDownloader::verifyLanguageAndVersion $language $version isClient
+
+ if {$isClient} then {
+ error "cannot stage files: client files must be committed directly"
+ }
+
+ ::PackageDownloader::verifyPlatform $platform platform
verifyCheckoutDirectory
if {![verifyThereAreNoChanges]} then {
error "cannot stage files: there are pending changes"
}
@@ -1020,11 +1027,11 @@
error "cannot stage files: still on wrong branch"
}
}
set targetDirectory [file join \
- $checkoutDirectory $language $version $platform]
+ $checkoutDirectory packages $language $version $platform]
set relativeFileNames [getRelativeFileNames $fileNames 2]
foreach fileName $fileNames relativeFileName $relativeFileNames {
file mkdir [file join \
Index: client/1.0/neutral/pkgu.eagle.asc
==================================================================
--- client/1.0/neutral/pkgu.eagle.asc
+++ client/1.0/neutral/pkgu.eagle.asc
@@ -1,18 +1,18 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository
-iQIcBAABCAAGBQJZRA2KAAoJEFAslq9JXcLZQrsP/11geOWHiyTLojbrKZjwouoQ
-g9wSUjhZL8PE0wHGndzY/7GuahLO09k8ug5laSWked+uY8nkyDb4zZG0xt7lRthR
-EnSf6820083CbVl9cGpyHiCrHDSCwMvJoIusrqHySlWyWoeZzYAuTb7rUiD/s1ZG
-oFei3CXpdYHaJfH6BZBWQ9sx6j/skUjN9nmCWSu6dfUxTkxNYjxRJ/1nUvePQkMO
-HHy/xD/SMETzA5BdiENEhG+OHHf7h6ESSz83jCLGsWvP6Slj8nB12dFmuo4qsFK3
-XhUG8Z0n+d+OAuiUQ1CiQHp0r45JRzrNGC25mHPQ1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iKfxkJUBEiFtqlOpan+q+BySgKoGDJEctgnUFOyrpW/D3/
+a44L1rvsdwfxC+qMEcU7
+=VYm+
-----END PGP SIGNATURE-----
Index: client/1.0/neutral/pkgu.eagle.harpy
==================================================================
--- client/1.0/neutral/pkgu.eagle.harpy
+++ client/1.0/neutral/pkgu.eagle.harpy
@@ -19,50 +19,50 @@
None
Mistachkin Systems
- de15d19d-5798-42ff-9c89-3d20755c3a78
+ 28cc2e15-66ae-42db-bc44-21d2ec349eff
SHA512
Script
- 2017-06-16T16:55:22.0752445Z
+ 2017-07-21T21:55:02.4101562Z
-1.00:00:00
0x9559f6017247e3e2
- PlpdxAJegUhMNw4TGnEfIAUANZdOTW1bkHrCm+YHcldG9SGdLvtp64eHyBWs6AsKBW+079qrgQY7
- C3XPZsqBKie0epExTx60Ygg4Ton9EGfC66FpMBRCfianoihvmLeaz1gpbgj/5kqG7rJf5EDRpI9Z
- PKRB8lV1rX3AjjyHZ6CqUQE7y1Ii1KRxSsX8EkLfz6MNOO9knsX1aU+pmUuZiuawz2PLGnrUOUvG
- tfPoYygqz2FUJsGQPHF4K4na66+plQkfTImH28wBrXWw1MmrRpfs2g/wbb4PkXIcW0lsw5N8KCZi
- l0n4U9XP8qyA+C+fBjQjt6RBRPLRUGV9rtp/3oqlWWK7upee46HZmG/TmFmdFLEtObp7ehqiVFXE
- jxIAYmyb1Uu9k6a18MMij3pxS5lxconG5F1s+Ei87LEVtLCiJOFQRpzrIYEEZCKrqz0bNkfR/ji4
- bQWhWdq+0kKz+sJ5SgJE3neAQmcvHYxafAdPmFw5kYe8dgGzBlSfbcm8my8T+F9KZodXiTK9o4Wy
- mExt59awaMdCurSyNIXQJlqnIauA+/9rcLNXODeoEbarg8Pp0szeC+gBIdw4GtAqse384K+olCWB
- wNScvjxOcXJqm+MQPeeRqWJ+0EdVx6rrPpd/mVadskcobuN14DQH27XsnWNSg4WEJYbjUVS/FLPv
- /GdAJNwpiOY+iBczW8gQGGno0y+odk+xu11RKy+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oY6wbFAKgu0fdqbIJD
+ eGWFi5xU+d+Pw/nGJpwVRGiqQfaHQttNft7D3AlJpyVf2NnVkt6PEMMVcdzI3yo+GKrR5TXzzIGZ
+ am93O0JVp675PWzEccI5ln+wt7+qwmpL03Gj1oExXHzkuYSey1+FA6Ca9cmzjVXSzOFml1EO0K3T
+ D2Rtf5mkNiwVFuQnqZTpGoC+ZnqsQls/LTEvdFxnqvEqx9GLgabKJd8dOG1FCPNPWhR4jf+z3YCx
+ R9JwsuxFIwg9X19xw1T1jlqQqvwrxzPVUvALj/SDYZv/y/WBsmFzYv7fSVnGL3olKobNnu2yvPtk
+ 8mYltiKpOIG7AuR+kTUAP8fTYnUGTrljnSV+0hpb/ofYKwUM3QyBPuIZHVn2jWcPak4esbjarIiU
+ kpd3fRSP/+r38ajXz/K7nTL6y24y3WPw/0BlxAd8ivYJbtFwn6giuuiQmjtvMBNnf/+32TRDbdTU
+ JTRfTcNoBT+FRg3akKKpw49wLIBtsCOEIKXMThjvgoQAe9d1u9VXjGHp4BLJ/WF1lXOIHKc=
Index: client/1.0/neutral/pkgu.eagle.harpy.asc
==================================================================
--- client/1.0/neutral/pkgu.eagle.harpy.asc
+++ client/1.0/neutral/pkgu.eagle.harpy.asc
@@ -1,18 +1,18 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Eagle Package Repository
-iQIcBAABCAAGBQJZRA2MAAoJEFAslq9JXcLZOIwP/RqtMsjG7gR1+sV+MRsMaqHx
-FJzvv35jjmKLloyRmAfX3wMT49B3oN6aOXSJbbjZguhNRl9Qjf0r0m+EHTzLvxLK
-xNLo8u2M0VFWoecDIwb8/4nw/HcZjFYHuvixULvVJY3qZLAjSTeAXXO+E0956VK0
-tzsQOvHXuvFR2jg2hE3yptlOCd14FgG7kES0vuq8b3tc0xiKGP9dKqxdncws5AUY
-SCQ2ji3JzsjqFclMe80pT9rxY2feObuhKwjmZcoOTDuMNmMDXUwO1JdSar8y1cuQ
-PCaebxH8+6gR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amMe5L2TJgYtqTyC8uYvAv0w+U8jL4zobXFi8tv9tVZMBAac/siDG5Sf+rh
+PXLuGqvX5H8dpykQtZ1d
+=u3Gb
-----END PGP SIGNATURE-----
DELETED eagle/1.0/neutral/data1.0/data.eagle
Index: eagle/1.0/neutral/data1.0/data.eagle
==================================================================
--- eagle/1.0/neutral/data1.0/data.eagle
+++ eagle/1.0/neutral/data1.0/data.eagle
@@ -1,1139 +0,0 @@
-###############################################################################
-#
-# data.eagle --
-#
-# Extensible Adaptable Generalized Logic Engine (Eagle)
-# Data Utility Package
-#
-# 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: Use our own namespace here because even though we do not directly
-# support namespaces ourselves, we do not want to pollute the global
-# namespace if this script actually ends up being evaluated in Tcl.
-#
-namespace eval ::Eagle {
- #
- # NOTE: This procedure is used to report errors during the various data
- # processing operations. In "strict" mode, these errors are always
- # fatal; otherwise, the errors are kept in a global "errors" variable
- # for later reporting.
- #
- proc report { {message ""} {data ""} {strict 0} } {
- if {$strict} then {
- error [list message $message data $data]
- } else {
- lappend ::errors [list message $message data $data]
-
- if {[lindex [info level -1] 0] ne "fail"} then {
- if {[string length $message] > 0} then {
- host result Error [appendArgs \n "message: " $message \n]
- }
-
- if {[string length $data] > 0} then {
- host result Error [appendArgs \n "data: " $data \n]
- }
- }
- }
- }
-
- proc fail { {error ""} } {
- report $error "" 0; # NOTE: Non-strict, report only.
-
- if {[string length $error] > 0} then {
- putsStdout $error
- }
-
- if {[info exists ::usage]} then {
- putsStdout $::usage
- }
-
- error $error
- }
-
- proc getArchitecture {} {
- if {[info exists ::tcl_platform(machine)] && \
- [string length $::tcl_platform(machine)] > 0} then {
- #
- # NOTE: Check for the "amd64" (i.e. "x64") architecture.
- #
- if {$::tcl_platform(machine) eq "amd64"} then {
- return x64
- }
-
- #
- # NOTE: Check for the "ia32_on_win64" (i.e. "WoW64") architecture.
- #
- if {$::tcl_platform(machine) eq "ia32_on_win64"} then {
- return x86
- }
-
- #
- # NOTE: Check for the "ia64" architecture.
- #
- if {$::tcl_platform(machine) eq "ia64"} then {
- return ia64
- }
-
- #
- # NOTE: Check for the "intel" (i.e. "x86") architecture.
- #
- if {$::tcl_platform(machine) eq "intel"} then {
- return x86
- }
-
- #
- # NOTE: We do not support this architecture.
- #
- putsStdout [appendArgs "Machine \"" $::tcl_platform(machine) \
- "\" is unsupported."]
-
- return unknown
- }
-
- putsStdout [appendArgs "Machine detection failed."]
-
- return none
- }
-
- #
- # NOTE: With the native library pre-loading feature and a proper application
- # local deployment of System.Data.SQLite, as shown here:
- #
- # * \System.Data.SQLite.dll (managed-only core assembly)
- # * \x86\SQLite.Interop.dll (x86 native interop assembly)
- # * \x64\SQLite.Interop.dll (x64 native interop assembly)
- #
- # -OR-
- #
- # * \System.Data.SQLite.dll (managed-only core assembly)
- # * \x86\sqlite3.dll (x86 native library)
- # * \x64\sqlite3.dll (x64 native library)
- #
- # Using this procedure is no longer necessary.
- #
- proc setupForSQLite { path } {
- #
- # NOTE: The toolPath is the directory where the caller is running from.
- #
- set toolPath $path
-
- putsStdout [appendArgs "Tool path is \"" $toolPath "\"."]
-
- #
- # NOTE: The externalsPath is the parent of the application root directory,
- # which should be the Externals directory (i.e. the one containing
- # the "sqlite3" and "System.Data.SQLite" directories). If this is
- # not the case, append "Externals" to the directory and try there.
- #
- set externalsPath [file dirname $toolPath]
-
- if {[file tail $externalsPath] ne "Externals"} then {
- set externalsPath [file join $externalsPath Externals]
- }
-
- putsStdout [appendArgs "Externals path is \"" $externalsPath "\"."]
-
- #
- # NOTE: This is the list of file names we need to copy into the
- # application binary directory. Currently, this includes the
- # "sqlite3.dll" and "System.Data.SQLite.dll" files, which are
- # necessary when using SQLite from Eagle.
- #
- set fileNames [list \
- [file join $externalsPath sqlite3 [getArchitecture] sqlite3.dll] \
- [file join $externalsPath System.Data.SQLite System.Data.SQLite.dll]]
-
- #
- # NOTE: The binaryPath is the directory where the application is running
- # from.
- #
- set binaryPath [info binary]
-
- putsStdout [appendArgs "Binary path is \"" $binaryPath "\"."]
-
- #
- # NOTE: Attempt to copy each of the files we need to the application
- # binary directory. Hopefully, the CLR will be able to load them
- # from there.
- #
- foreach fileName $fileNames {
- if {![file exists $fileName]} then {
- #
- # NOTE: It seems the source file does not exist, skip it.
- #
- putsStdout [appendArgs "File \"" $fileName "\" does not exist."]
-
- continue
- }
-
- set justFileName [file tail $fileName]
- set newFileName [file join $binaryPath $justFileName]
-
- if {$justFileName eq "sqlite3.dll"} then {
- set magic 0
- set error null
-
- if {![object invoke Eagle._Components.Private.FileOps \
- CheckPeFileArchitecture $fileName magic error]} then {
- #
- # NOTE: The "sqlite3.dll" file does not match the current operating
- # system architecture (e.g. 32-bit DLL on 64-bit Windows).
- #
- fail [object invoke $error ToString]
- } else {
- putsStdout [appendArgs "File \"" $fileName "\" PE magic OK (" \
- [string format "0x{0:X}" $magic] ")."]
- }
- }
-
- if {![file exists $newFileName]} then {
- #
- # NOTE: The destination file does not exist, copy it.
- #
- file copy $fileName $newFileName
-
- putsStdout [appendArgs "Copied \"" $fileName "\" to \"" \
- $newFileName "\"."]
- } else {
- #
- # NOTE: It seems the destination file already exists, skip it.
- #
- putsStdout [appendArgs "File \"" $newFileName "\" exists."]
- }
- }
- }
-
- proc showTime { name script } {
- putsStdout [appendArgs "\n\nStarted " $name " at " \
- [clock format [clock seconds]] .]
-
- set elapsed [time {uplevel 1 $script}]
-
- putsStdout [appendArgs "\n\nStopped " $name " at " \
- [clock format [clock seconds]] .]
-
- putsStdout [appendArgs "Completed in " \
- $elapsed .]
- }
-
- proc haveChannel { name } {
- if {![info exists ::haveChannel($name)]} then {
- set ::haveChannel($name) \
- [expr {[lsearch -exact [file channels] $name] != -1}]
- }
-
- return $::haveChannel($name)
- }
-
- proc putsStdout { args } {
- #
- # NOTE: Is the 'stdout' channel available?
- #
- if {[haveChannel stdout]} then {
- #
- # NOTE: Do we need to emit a trailing newline?
- #
- if {[llength $args] == 2 && \
- [lindex $args 0] eq "-nonewline"} then {
- #
- # NOTE: Output the second argument with no newline.
- #
- catch {
- puts -nonewline stdout [lindex $args 1]
- flush stdout
- }
- } else {
- #
- # NOTE: Output the first argument with a newline.
- #
- catch {
- puts stdout [lindex $args 0]
- flush stdout
- }
- }
- } else {
- #
- # HACK: Since there is no 'stdout' channel, this procedure is
- # totally useless; therefore, we simply redefine it to do
- # nothing.
- #
- proc putsStdout { args } {}
- }
- }
-
- proc readBadFile { fileName {readProc readFile} } {
- #
- # HACK: This "text" file (as exported by MySQL) has a bad mixture of
- # utf-8 and windows-1252 code points in it. At a bare minimum,
- # we want to change the utf-8 code points that are used in the
- # data as column and row delimiters and change them to valid
- # windows-1252 code points.
- #
- return [string map [list \xC3\xBF \xFF \xC3\xBE \xFE] \
- [$readProc $fileName]]
- }
-
- #
- # WARNING: Do not use this procedure unless you know exactly what it does.
- #
- proc readUtf8File { fileName } {
- set file_id [open $fileName RDONLY]
- fconfigure $file_id -encoding utf-8 -translation auto
- set result [read $file_id]
- close $file_id
- return $result
- }
-
- proc executeSQLite { fileName sql {strict 0} } {
- try {
- set connection [sql open -type SQLite \
- [subst {Data Source=${fileName}}]]
-
- if {[catch {sql execute $connection $sql} error] != 0} then {
- report [appendArgs "sql statement error: " $error] \
- [list $sql] $strict
- }
- } finally {
- if {[info exists connection]} then {
- sql close $connection; unset connection
- }
- }
- }
-
- proc scanAsciiChars {
- fileName {readProc readFile} {startIndex 0} {skip ""} {strict 0} } {
- #
- # NOTE: Read all the data from the file into memory using the
- # specified procedure.
- #
- # BUGFIX: *PERF* Use a real System.String object here (via an
- # opaque object handle) and query each byte in the loop
- # below as necessary. This prevents the whole string
- # from being needlessly copied back and forth in memory
- # repeatedly (i.e. during command invocation).
- #
- set data [object create -alias String [$readProc $fileName]]
- set length [$data Length]
- set chunk 1024
-
- putsStdout [appendArgs "Scanning " $length " bytes of data (" \
- $chunk " bytes per chunk)...\n"]
-
- for {set index $startIndex} {$index < $length} {incr index} {
- #
- # NOTE: Grab the byte value of the specified "character" in
- # the string from the opaque object handle.
- #
- set value [string ordinal [$data get_Chars $index] 0]
-
- if {[lsearch -integer $skip $value] != -1} then {
- continue
- }
-
- if {$value < 32 || $value == 127} then {
- report [appendArgs "found control character " $value " (" \
- [string format "0x{0:X}" $value] ") at index " $index] "" \
- $strict
- } elseif {$value > 126} then {
- report [appendArgs "found bad character " $value " (" \
- [string format "0x{0:X}" $value] ") at index " $index] "" \
- $strict
- }
-
- if {$index % $chunk == 0} then {
- putsStdout -nonewline 0
- }
- }
- }
-
- proc importDelimited {
- fileName tableName {readProc readFile} {columnDelimiter \t}
- {rowDelimiter \r\n} {strict 0} } {
- #
- # NOTE: Read all the data from the file into memory using the
- # specified procedure.
- #
- # BUGFIX: *PERF* Use a real System.String object here (via an
- # opaque object handle) and query each byte in the loop
- # below as necessary. This prevents the whole string
- # from being needlessly copied back and forth in memory
- # repeatedly (i.e. during command invocation).
- #
- set data [object create -alias String [$readProc $fileName]]
-
- #
- # HACK: Check for a detached header file. This should contain
- # exactly one row (including the trailing row delimter)
- # with just the column names [separated by the column
- # delimiter].
- #
- set headerFileName [file join [file dirname $fileName] \
- [appendArgs header_ [file tail $fileName]]]
-
- if {[file exists $headerFileName]} then {
- putsStdout [appendArgs "Found detached header file \"" \
- $headerFileName "\" for data file \"" $fileName \
- "\", reading..."]
-
- set headerData [object create -alias String [$readProc \
- $headerFileName]]
- }
-
- #
- # NOTE: Split the data using the row delimiter. We use the
- # -string option here to allow for the use of a
- # multi-character row delimiters. For data containing
- # literal cr/lf characters, a non-cr/lf row delimiter
- # must be used.
- #
- set rowDelimiters [object create -alias String\[\] 1]
- $rowDelimiters SetValue $rowDelimiter 0
- set lines [$data -create -alias Split $rowDelimiters None]
-
- #
- # NOTE: Determine how many rows of data there are. There must
- # be more than zero to continue.
- #
- set rowCount [$lines Length]
-
- #
- # NOTE: We cannot proceed if there are no rows of data.
- #
- if {$rowCount == 0} then {
- fail "no rows of data"
- }
-
- #
- # NOTE: If we read the header data from the detached header file,
- # use it; otherwise, grab the first line of the data. This
- # line must be the header line (i.e. it must contain the
- # column names and nothing else).
- #
- if {[info exists headerData]} then {
- set headerLine [$headerData ToString]
-
- #
- # NOTE: All data rows are actually data; therefore, start on
- # the first row.
- #
- set rowIndex 0
- } else {
- set headerLine [$lines GetValue 0]
-
- #
- # NOTE: The first data row is really the header line; therefore,
- # start on the second row.
- #
- set rowIndex 1
- }
-
- #
- # NOTE: We cannot proceed if the header line is empty.
- #
- if {[string length $headerLine] == 0} then {
- fail "invalid file header"
- }
-
- putsStdout [appendArgs "\n\nAttempting to import " $rowCount \
- " rows starting at index " $rowIndex "...\n"]
-
- #
- # NOTE: Unquote the column name (i.e. removes single and
- # double quotation marks). Technically, this may
- # be too liberal since it will remove all leading
- # and trailing single and double quotes; however,
- # these are the column names, not data, and should
- # not contain any single or double quotes.
- #
- set unquote [list [list x] { return [string trim $x '\"] }]
-
- #
- # NOTE: Split the header line using the column delimiter.
- # We use the -string option here to allow for the
- # use of a multi-character column delimiter. For
- # data containing literal tab characters, a non-tab
- # column delimiter must be used.
- #
- set headerColumns [map \
- [split $headerLine $columnDelimiter -string] \
- {apply $unquote}]
-
- set columnCount [llength $headerColumns]
-
- #
- # NOTE: We cannot proceed if there are no column names.
- #
- if {$columnCount == 0} then {
- fail "no columns in header"
- }
-
- #
- # NOTE: Using the table name, access the in-memory table
- # from the calling context. By convention, the
- # variable name will be "_rows".
- #
- upvar 1 [appendArgs $tableName _rows] table
-
- #
- # NOTE: Set the necessary metadata used by the export
- # procedure into the table array.
- #
- set table(columns) $headerColumns
- set table(imported) 0
- set table(startIndex) $rowIndex
-
- #
- # NOTE: There is no loop initializer here, see above.
- #
- for {} {$rowIndex < $rowCount} {incr rowIndex} {
- #
- # NOTE: Grab the previous line of data, if available.
- #
- if {$rowIndex > 0} then {
- set previousLine [$lines GetValue [expr {$rowIndex - 1}]]
- } else {
- set previousLine ""
- }
-
- #
- # NOTE: Grab the current line of data.
- #
- set line [$lines GetValue $rowIndex]
-
- #
- # NOTE: Is the current line of data empty?
- #
- if {[string length $line] == 0} then {
- #
- # NOTE: We do not care if the final row of data is
- # empty.
- #
- if {$rowIndex + 1 < $rowCount} then {
- #
- # NOTE: An empty row of data could indicate a corrupt
- # data dump; however, it is almost always safe
- # to simply ignore blank lines.
- #
- report [appendArgs "row #" $rowIndex " is empty"] \
- [list previous $previousLine] $strict
- }
-
- continue
- }
-
- #
- # NOTE: Split the current line using the column delimiter.
- # We use the -string option here to allow for the
- # use of a multi-character column delimiter. For
- # data containing literal tab characters, a non-tab
- # column delimiter must be used.
- #
- set columns [split $line $columnDelimiter -string]
- set count [llength $columns]
-
- #
- # NOTE: Did we find some columns in the current line of
- # data? Given the check for an empty line of data
- # above, this should almost always succeed.
- #
- if {$count == 0} then {
- #
- # NOTE: A row of data with no columns could indicate a
- # corrupt data dump.
- #
- report [appendArgs "row #" $rowIndex " has no columns"] \
- [list previous $previousLine current $line] $strict
-
- continue
- }
-
- #
- # NOTE: Does the current line of data contain the correct
- # number of columns (based on the header)? If the
- # data dump is subtly corrupted in some way, this
- # is the most likely error to be seen.
- #
- if {$count != $columnCount} then {
- #
- # NOTE: A row of data with an incorrect number of columns
- # almost certainly indicates at least some level of
- # data dump corruption. We can ignore it and proceed;
- # however, each of these errors should be individually
- # investigated at the very least.
- #
- report [appendArgs "row #" $rowIndex " has " $count \
- " columns, expected " $columnCount] [list current $line] $strict
-
- continue
- }
-
- #
- # NOTE: Process each column value for this row and add it
- # to the in-memory table.
- #
- set columnIndex 0
-
- for {} {$columnIndex < $count} {incr columnIndex} {
- set columnName [lindex $headerColumns $columnIndex]
- set columnValue [lindex $columns $columnIndex]
-
- #
- # NOTE: Is the first character a single or double quote?
- #
- if {[string index $columnValue 0] eq "'" || \
- [string index $columnValue 0] eq "\""} then {
- #
- # NOTE: Ok, remove the first character.
- #
- set columnValue [string range $columnValue 1 end]
- }
-
- #
- # NOTE: Is the last character a single or double quote?
- #
- if {[string index $columnValue end] eq "'" || \
- [string index $columnValue end] eq "\""} then {
- #
- # NOTE: Ok, remove the last character.
- #
- set columnValue [string range $columnValue 0 end-1]
- }
-
- set table($rowIndex,$columnName) $columnValue
- }
-
- incr table(imported)
- putsStdout -nonewline .
- }
-
- set table(count) $table(imported)
- }
-
- proc exportFixedLength {
- tableName fileName fields {maps ""} {regsubs ""} {strict 0} } {
- #
- # NOTE: Using the table name, access the in-memory table
- # from the calling context. By convention, the
- # variable name will be "_rows".
- #
- upvar 1 [appendArgs $tableName _rows] table
-
- set headerColumns $table(columns)
- set columnCount [llength $headerColumns]
-
- #
- # NOTE: So far, we have not exported any rows.
- #
- set table(exported) 0
-
- #
- # NOTE: Grab the necessary metadata from the table array.
- #
- set rowCount $table(count)
- set startIndex $table(startIndex)
- set rowIndex $startIndex
-
- putsStdout [appendArgs "\n\nAttempting to export " $rowCount \
- " rows starting at index " $rowIndex "...\n"]
-
- #
- # NOTE: Process each row in the passed-in array. There is no
- # loop initializer here, see above.
- #
- set data ""
-
- for {} {$rowIndex < $rowCount + $startIndex} {incr rowIndex} {
- #
- # NOTE: Start out with an empty row value. After all the fields
- # are processed, this will be added to the overall data block
- # to export.
- #
- set rowValue ""
-
- #
- # NOTE: Process each field in the passed-in list.
- #
- set fieldIndex 0
-
- for {} {$fieldIndex < [llength $fields]} {incr fieldIndex} {
- #
- # NOTE: What is the length of this row so far?
- #
- set rowLength [string length $rowValue]
-
- #
- # NOTE: Grab the field [definition] from the list.
- #
- set field [lindex $fields $fieldIndex]
-
- #
- # NOTE: Make sure the field has the required elements.
- #
- if {[llength $field] < 3} then {
- report [appendArgs \
- "field #" $fieldIndex " has " [llength $field] \
- " elements, expected at least 3"] "" $strict
-
- continue
- }
-
- #
- # NOTE: Extract and validate the field identifier. This element is
- # always required and must be a valid integer.
- #
- set fieldId [string trim [lindex $field 0]]
-
- if {![string is integer -strict $fieldId]} then {
- report [appendArgs \
- "field #" $fieldIndex " has an invalid identifier \"" \
- $fieldId \"] "" $strict
-
- continue
- }
-
- #
- # NOTE: Extract and validate the field name. This element is
- # always required.
- #
- set fieldName [string trim [lindex $field 1]]
-
- if {[string length $fieldName] == 0} then {
- report [appendArgs \
- "field #" $fieldIndex " has an empty name"] "" $strict
-
- continue
- }
-
- #
- # NOTE: Extract and validate the field width. This element is
- # always required and must be a valid integer greater than
- # zero.
- #
- set fieldWidth [string trim [lindex $field 2]]
-
- if {![string is integer -strict $fieldWidth]} then {
- report [appendArgs \
- "field #" $fieldIndex " has an invalid width \"" \
- $fieldWidth \"] "" $strict
-
- continue
- }
-
- #
- # NOTE: The field width must be positive and greater than zero.
- #
- if {$fieldWidth <= 0} then {
- report [appendArgs \
- "field #" $fieldIndex " has width \"" $fieldWidth \
- "\", which is less than or equal to zero"] "" $strict
-
- continue
- }
-
- #
- # NOTE: Extract and validate the field start. This element is
- # optional; if specified, it must be an integer.
- #
- set fieldStart [string trim [lindex $field 3]]
-
- if {[string length $fieldStart] == 0} then {
- set fieldStart $rowLength
- }
-
- if {![string is integer -strict $fieldStart]} then {
- report [appendArgs \
- "field #" $fieldIndex " has an invalid start \"" \
- $fieldStart \"] "" $strict
-
- continue
- }
-
- #
- # NOTE: The field start cannot occur before the current position in
- # the row being built (i.e. fields are always processed in the
- # order they occur in the list provided by the caller).
- #
- if {$fieldStart < $rowLength} then {
- report [appendArgs \
- "field #" $fieldIndex " cannot start at \"" $fieldStart \
- "\", already beyond that point"] "" $strict
-
- continue
- }
-
- #
- # NOTE: Extract and validate the field alignment. This element is
- # optional; if specified, it must be either "left" or "right".
- #
- set fieldAlignment [string trim [lindex $field 4]]
-
- if {[string length $fieldAlignment] == 0} then {
- set fieldAlignment right
- }
-
- if {$fieldAlignment ni [list left right]} then {
- report [appendArgs \
- "field #" $fieldIndex " has an invalid alignment \"" \
- $fieldAlignment "\", must be \"left\" or \"right\""] "" \
- $strict
-
- continue
- }
-
- #
- # NOTE: Extract and validate the field type. This element is
- # optional; if specified, it must be either "string",
- # "number", or "datetime".
- #
- set fieldType [string trim [lindex $field 5]]
-
- if {[string length $fieldType] == 0} then {
- set fieldType string
- }
-
- if {$fieldType ni [list string number datetime]} then {
- report [appendArgs \
- "field #" $fieldIndex " has an invalid type \"" $fieldType \
- "\", must be \"string\", \"number\", or \"datetime\""] "" \
- $strict
-
- continue
- }
-
- #
- # NOTE: Extract and validate the field format. This element is
- # optional.
- #
- set fieldFormat [lindex $field 6]; # NOTE: No trim.
-
- #
- # NOTE: Search for the column in the list of columns. If it cannot
- # be found, use an empty string for the column name and value.
- # We cannot simply skip the column because the format string
- # may simply be a literal string that does not require the
- # column value.
- #
- set columnIndex [lsearch -exact $headerColumns $fieldName]
-
- if {$columnIndex != -1} then {
- set columnName [lindex $headerColumns $columnIndex]
- set columnValue $table($rowIndex,$columnName)
- } else {
- set columnName ""
- set columnValue ""
- }
-
- #
- # HACK: Perform any replacements specified by the caller. This is
- # done in two phases. Typically, the first phase is used to
- # escape characters (e.g. by converting them to HTML entities)
- # and the second phase is [optionally] used to undo any double
- # escapes that may have been created during the first phase.
- #
- if {[llength $maps] > 0} then {
- foreach map $maps {
- if {[llength $map] > 0} then {
- set columnValue [string map $map $columnValue]
- }
- }
- }
-
- #
- # HACK: Perform any regular expression replacements specified by the
- # caller.
- #
- if {[llength $regsubs] > 0} then {
- foreach regsub $regsubs {
- #
- # NOTE: Each element in the list must have exactly 2 elements.
- # The first element must be the regular expression. The
- # second element must be the replacement pattern.
- #
- if {[llength $regsub] == 2} then {
- regsub -all -- [lindex $regsub 0] $columnValue \
- [lindex $regsub 1] columnValue
- }
- }
- }
-
- #
- # NOTE: Check if an explicit format string was specified. If so,
- # use the appropriate formatting command for the data type.
- #
- if {[string length $fieldFormat] > 0} then {
- switch -exact -- $fieldType {
- string {
- set columnValue [object invoke String Format \
- $fieldFormat $columnValue]
- }
- number {
- set columnValue [format $fieldFormat $columnValue]
- }
- datetime {
- if {[string length $columnValue] > 0 && \
- ![string is integer -strict $columnValue]} then {
- #
- # NOTE: The value is not an integer; therefore,
- # try to scan it as a date and/or time.
- #
- set columnValue [clock scan $columnValue]
- }
-
- set columnValue [clock format $columnValue \
- -format $fieldFormat]
- }
- default {
- report [appendArgs \
- "field #" $fieldIndex " has bad type \"" \
- $fieldAlignment \"] "" $strict
-
- continue
- }
- }
- }
-
- #
- # NOTE: Check the formatted column length against the field width.
- # If the formatted column length is greater, it must be
- # truncated. Otherwise, if the formatted column length is
- # less, it must be padded according to the field alignment.
- #
- set columnLength [string length $columnValue]
-
- if {$columnLength > $fieldWidth} then {
- #
- # NOTE: Truncate the string; otherwise, it will not fit within
- # the field.
- #
- if {$fieldAlignment eq "left"} then {
- set columnValue [string range $columnValue \
- [expr {$columnLength - $fieldWidth}] end]
- } else {
- set columnValue [string range $columnValue \
- 0 [expr {$fieldWidth - 1}]]
- }
-
- report [appendArgs \
- "column \"" $columnName "\" value at row #" $rowIndex \
- " (length " $columnLength ") exceeds width of field #" \
- $fieldIndex " (width " $fieldWidth "), truncated"] "" \
- $strict
- } else {
- set padding [string repeat " " \
- [expr {$fieldWidth - $columnLength}]]
-
- if {$fieldAlignment eq "left"} then {
- set columnValue [appendArgs $columnValue $padding]
- } else {
- set columnValue [appendArgs $padding $columnValue]
- }
- }
-
- #
- # NOTE: If this field starts at some point after the end of the
- # row value built so far, pad it.
- #
- if {$fieldStart > $rowLength} then {
- set padding [string repeat " " \
- [expr {$fieldStart - $rowLength}]]
- } else {
- set padding ""
- }
-
- #
- # NOTE: Append the necessary padding and the final column value
- # to the row value.
- #
- append rowValue $padding $columnValue
- }
-
- #
- # NOTE: Append the row value to the overall data block to export.
- #
- append data $rowValue
-
- incr table(exported)
- putsStdout -nonewline *
- }
-
- writeFile $fileName $data
- }
-
- proc exportSQLite {
- tableName fileName {sql ""} {maps ""} {regsubs ""} {strict 0} } {
- #
- # NOTE: Export the in-memory table to the specified SQLite
- # database file.
- #
- try {
- set connection [sql open -type SQLite \
- [subst {Data Source=${fileName}}]]
-
- #
- # NOTE: If custom SQL was specified, execute it against
- # the database connection now.
- #
- if {[string length $sql] > 0} then {
- sql execute $connection $sql
- }
-
- #
- # NOTE: Using the table name, access the in-memory table
- # from the calling context. By convention, the
- # variable name will be "_rows".
- #
- upvar 1 [appendArgs $tableName _rows] table
-
- set headerColumns $table(columns)
- set columnCount [llength $headerColumns]
-
- #
- # NOTE: Wraps the column name in square brackets.
- #
- set wrap [list [list x] { return [appendArgs \[ $x \]] }]
-
- #
- # NOTE: Build the parameterized SQL statement to execute an
- # INSERT (or UPDATE) of a single row.
- #
- set rowSql [appendArgs \
- "INSERT OR REPLACE INTO \[" $tableName "\] (" \
- [join [map $headerColumns {apply $wrap}] ,] ") VALUES(" \
- [join [lrepeat $columnCount ?] ,] ");"]
-
- #
- # NOTE: Build the per-row script to evaluate for adding or
- # updating a row in the database.
- #
- set script {eval sql execute -verbatim \
- [list $connection] [list $rowSql] $columnParams}
-
- #
- # NOTE: So far, we have not exported any rows.
- #
- set table(exported) 0
-
- #
- # NOTE: Grab the necessary metadata from the table array.
- #
- set rowCount $table(count)
- set startIndex $table(startIndex)
- set rowIndex $startIndex
-
- putsStdout [appendArgs "\n\nAttempting to export " $rowCount \
- " rows starting at index " $rowIndex "...\n"]
-
- #
- # NOTE: Process each row in the passed-in array. There is no loop
- # initializer here, see above.
- #
- for {} {$rowIndex < $rowCount + $startIndex} {incr rowIndex} {
- set columnParams [list]
-
- #
- # NOTE: Process each column value for this row and add it to the
- # list of parameters for the SQL statement to execute.
- #
- set columnIndex 0
-
- for {} {$columnIndex < $columnCount} {incr columnIndex} {
- set columnName [lindex $headerColumns $columnIndex]
- set columnValue $table($rowIndex,$columnName)
-
- #
- # HACK: Perform any replacements specified by the caller. This is
- # done in two phases. Typically, the first phase is used to
- # escape characters (e.g. by converting them to HTML entities)
- # and the second phase is [optionally] used to undo any double
- # escapes that may have been created during the first phase.
- #
- if {[llength $maps] > 0} then {
- foreach map $maps {
- if {[llength $map] > 0} then {
- set columnValue [string map $map $columnValue]
- }
- }
- }
-
- #
- # HACK: Perform any regular expression replacements specified by the
- # caller.
- #
- if {[llength $regsubs] > 0} then {
- foreach regsub $regsubs {
- #
- # NOTE: Each element in the list must have exactly 2 elements.
- # The first element must be the regular expression. The
- # second element must be the replacement pattern.
- #
- if {[llength $regsub] == 2} then {
- regsub -all -- [lindex $regsub 0] $columnValue \
- [lindex $regsub 1] columnValue
- }
- }
- }
-
- #
- # HACK: Make dates conform to the format needed by SQLite.
- #
- if {[regexp -- {^\d{4}/\d{1,2}/\d{1,2}$} $columnValue]} then {
- set dateTime [object invoke -alias DateTime Parse $columnValue]
- set columnValue [$dateTime ToString yyyy-MM-dd]
- }
-
- #
- # NOTE: Make sure to omit the parameter value if the column value
- # needs to be a literal NULL.
- #
- set columnParam [list [appendArgs param $columnIndex] String]
-
- if {$columnValue ne "NULL"} then {
- lappend columnParam $columnValue
- }
-
- #
- # NOTE: Add the parameter for this column to the list of parameters
- # to pass to the command.
- #
- lappend columnParams $columnParam
- }
-
- #
- # NOTE: Evaluate the per-row script used to actually insert or
- # update a row in the database. Catch and report on any
- # errors we encounter.
- #
- if {[catch $script error] != 0} then {
- report [appendArgs "sql statement error: " $error] \
- [list $rowSql $columnParams] $strict
- } else {
- #
- # NOTE: We successfully imported another row.
- #
- incr table(exported)
- }
-
- putsStdout -nonewline *
- }
- } finally {
- if {[info exists connection]} then {
- sql close $connection; unset connection
- }
- }
- }
-
- #
- # NOTE: Provide the Eagle library package to the interpreter.
- #
- package provide Eagle.Data \
- [expr {[isEagle] ? [info engine PatchLevel] : "1.0"}]
-}
-
DELETED eagle/1.0/neutral/data1.0/data.eagle.asc
Index: eagle/1.0/neutral/data1.0/data.eagle.asc
==================================================================
--- eagle/1.0/neutral/data1.0/data.eagle.asc
+++ eagle/1.0/neutral/data1.0/data.eagle.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJX1JQWAAoJEFAslq9JXcLZnPcQAKjLrT+W439ps4nNxAMcCcgC
-5p6UoMXwr9+34ffTi41jK3tN5cptUOe8PKhROG6FTJrJclNZFqkRJagVGKdcs3ED
-ykGKDLOSwI547jJNGKqfhrd199GsVr+cmhEI64+6j9U5RltKQtF+whJx89werTWd
-tRPedr09ET4QOW/W66Q0s7UjljEZZqkz2ErepBFhPLWbCWroYi6H795FxPA6nAlO
-15PlR9z1p8DAF4YpKC4zRK0NMUtEh8OnH1hJQ3E+n/1gJpvYV4el2hA7Z+uZ07xP
-NHT9nSKbJ8EwmVYy3+HCBduMp0X81VzMXM2kyzpeZF/tSxwi23SGZtXmc75icRa2
-iRj93h1jqhnB5+1OF7C+ezC3JesVPyngNXydPPOmKNi9AqRgUOSBRSzitBBFqE5C
-Pjl/rtzDOtdrcifv1+iRYwvF3W/EGNL2b8EY+g7/rYNUFrOcEaGMWx3ID/dw4xs1
-XeEWTi0lfuiyFs6CuleCGOAqV+IgU2se4mWZ0t2A/ZihQQ9FuektGCpAeeqBqIai
-KEgtZP2Chq8JBArlWc4qnMckdGyMLeJzp4ecBnWOI2yx+K0bxTHn0QxnLTvKUT0C
-qr1S0l1E3TwnHiNLIuS6soDPUHevgDDSJEARiLIcT7U5N9q0pbdJCCJKDqoK1NQ+
-0W3DKj684Zcn+SYzGDQ3
-=UI7f
------END PGP SIGNATURE-----
DELETED eagle/1.0/neutral/data1.0/data.eagle.harpy
Index: eagle/1.0/neutral/data1.0/data.eagle.harpy
==================================================================
--- eagle/1.0/neutral/data1.0/data.eagle.harpy
+++ eagle/1.0/neutral/data1.0/data.eagle.harpy
@@ -1,68 +0,0 @@
-
-
-
- None
- Mistachkin Systems
- 53cac383-800a-4e1a-ac9f-54d79a848e29
- SHA512
- Script
- 2016-08-23T04:09:36.0449687Z
- -1.00:00:00
- 0x9559f6017247e3e2
-
- L+dj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YTWXDi6pYQVdzgvUP5ZHI+jkX
- EtHK7WoFTaD8vYcLnGHHAD4a+7pZsVw5UFq4fdBHANMMmrURSwf9cq109nx+pDExR/RyqgPbnzxD
- kASCT6vHN2YuQbBLiRrMWb15upnMW2MBS/OgwWdm0xovhmsjrYd3dx6cg+JXNDqJ6+rZwqc9AMcq
- mLJUmCRN0hbmFpQ2KgqsBSWVmrYTTjvcVGh0I00tFOZNE58Cthhwojxey2iUiwkOCDq8rFrU90b0
- ko40+KzMMCmZY39iJ8OuX8KxT6GKrR2MoM79GYgHroh1VKPOU6qICVEHqUmfVbc3HLmihSiKazl5
- 8b+gFRfXJsFS7LMkFxYAo7MLqWzBIs9k+eTemfPA/AdkwNcwdPaOsTIpSQX9UwR0Ek661BFA2x0f
- hqYT123MMyzJHlqe+GRNFwJAmyfOsNwknDF8dorhBk16Vc1EsL7JRFhYOttGyEiGaMFZsHtdljxF
- 76ZhP/bKWYR+zOFbOnXzPJ1T0xTorofv6MxOEJvQ1nT5MHwdgXaPDXbk71aXuJgiNLymaSvuXZUm
- 7x3Dw9wOid9t0/5451QTOq0kbrdHAitVdcrcXKjzgg7NlccvAlncKP10JdsArJSFgdfZKp0=
-
-
DELETED eagle/1.0/neutral/data1.0/data.eagle.harpy.asc
Index: eagle/1.0/neutral/data1.0/data.eagle.harpy.asc
==================================================================
--- eagle/1.0/neutral/data1.0/data.eagle.harpy.asc
+++ eagle/1.0/neutral/data1.0/data.eagle.harpy.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJX1JQYAAoJEFAslq9JXcLZeJQQALuSwisANovxPGdhduKX0r+r
-E54ESvS08wGUsQTWvlb+SuvEhScTbtZevQXgXCX60CqFRYLbskeaMkZkNl8JeXks
-SoiD0OqEnuDMgOjF9CgnRTnsxK3y7jR4birycxH2IvVbS8TpTD/6Wl+A61zb0mwD
-9NB1R0DE6Ty0R4a5TDa6SWKRKwhE1hQOIm9X4ZGnL+zXYc90vBjeIaeYb9hlTDMU
-v6qvwok20JPaaOdDzNVVSDY25/p4q8HPsntTFBKEnlzjtMXoj2WhPpLi0uzFFRhI
-wpFpMeNVRUiQuEE0k5eHPFgSGzpEggObHEbEElPAySnWqvmCsEMdqqCDFKa0Rlkp
-go9Ab3YnXLQZcsm7NOM+uan+U0giglxWNY27+Lna6QpLGIg3UZsTFbpdpSVrCxMt
-zdOMfl+KYQt8NIvZwbX6OEURXYvgrJrIPQkrFH2LxgGT5Bx999ZFSSnyqjXN3Cb+
-XbJyoMWhuFY6dGkkCZLyitUz/esCn700EvVjmyKyM7gmUyPMSnVmQ3YNiY6GLF+6
-Pg2SJU6uFKsgSQoyHHzaJtrSyi2oA+Qu7KaqF/sfDcPPXTxrztwGn1xLhsHvFTiT
-F4+0Jj2+1iclj+STMDbkUcn5MZQS7JeP90Mr1UAvCWA3gDPA0ZyLgbVPddc7Kadj
-R+b87Ovem+vY4CKtpy7L
-=5Nek
------END PGP SIGNATURE-----
DELETED eagle/1.0/neutral/data1.0/pkgIndex.eagle
Index: eagle/1.0/neutral/data1.0/pkgIndex.eagle
==================================================================
--- eagle/1.0/neutral/data1.0/pkgIndex.eagle
+++ eagle/1.0/neutral/data1.0/pkgIndex.eagle
@@ -1,20 +0,0 @@
-###############################################################################
-#
-# pkgIndex.eagle --
-#
-# 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]} {return}
-if {![package vsatisfies [package provide Eagle] 1.0]} {return}
-
-package ifneeded Eagle.Data 1.0 [list source [file join $dir data.eagle]]
DELETED eagle/1.0/neutral/data1.0/pkgIndex.eagle.asc
Index: eagle/1.0/neutral/data1.0/pkgIndex.eagle.asc
==================================================================
--- eagle/1.0/neutral/data1.0/pkgIndex.eagle.asc
+++ eagle/1.0/neutral/data1.0/pkgIndex.eagle.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJX1JQcAAoJEFAslq9JXcLZZL0QAKPsxh3L1x5LYZ5r2KNO6hPZ
-P5T/7zFPyRLoIbqRvBdgeKMH4+yYlvYHVgPO4oiUNz9g03CZoh/GLZHt21twXVA2
-gzMlf68e1L2aNHpiqeR9LXbC1UpHPLFoCv28Gnk7F2UUk4cR/9CkcK38J2kMRNVD
-2sAWJM/bNsVJ3rz3A/b9dGIemAQZjZ4SRB3M1ecZaFqGo9wrhCGfMcDavoGHkR+7
-VX3dy3qvLWEEgnuBb10QdyAx2ORAry45UtrmuTUVFfQIk5f775vvefe5gxjKGNW3
-+8eYPPuIwWMgx3VANL0J7xf7sOxuA0MjdQhCnpAV2aIIlhY07rEZtdsY65LNF68d
-hExh2fGQeVzAayM8/zl8Tcy8nnInQag8lDOcfOchd8gae+f34HJ5ENxUVCTZUrPz
-gNlQq5FQwUvAbv5jvozXqARlBdCSwYgMdxYzfOKDVN49h4wpsZ4L6AjmeMOQLGzh
-l3Uem+1ToOXrbw7VFx1xUKZnzjSFbSsSNiU+F1DIfrRV1x2wloyeze63nZRmZVtn
-3A96nqPEr0BdP6E0kEn1f8LEgCHGefBgq83e/O4PnvZl8BKfuM1VMRb4ohno6f0k
-SgX3eMpB00ADK8mFI/TO/jrz0X33SWxlNZQpa46qRAt6pny7np/3Dpirt8I4r+fK
-A2PxwRU+4e4Va3dz5/s1
-=8Sv6
------END PGP SIGNATURE-----
DELETED eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy
Index: eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy
==================================================================
--- eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy
+++ eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy
@@ -1,68 +0,0 @@
-
-
-
- None
- Mistachkin Systems
- 092bc755-f131-430f-8c7e-6ce47756ec69
- SHA512
- Script
- 2016-08-23T04:43:50.7227031Z
- -1.00:00:00
- 0x9559f6017247e3e2
-
- qWSUmAwQawmj4AqAdy4DFQXAYAqZkikidSwK7BMz+pMiT0qSN/aiKnHq/yE3ERsVuZ1wwFlE6vOu
- dRJ9TfPCZNoaeQuMZj7lNAxumG8d125mSTUEdzkU+FH/DXXV4VSlROPCmf3k/kzG+jkqfx2VUJAu
- pkg7TqnqKDEWeYJoFMxKXmwxrSxui2g39EXqJoj7qBY7EVEQOpmAgspE13uD+8N08o1M8oor5jsm
- Akb4X2zCRZ1hEroQ9sb0FTTgfxYhyJMIVy9QnecNL9/cQ6pn30kX0ADzDK8oxIaR0wANDf8hscWW
- RPVEQStqnz97Px/5ljL2STmzXuhY7BUo+nClZclZ7B4tyk4fT/kjOI1CGYLOXN993N/6jycf2I9P
- ZP3+humf7Hd3iTi+QKsnc5bqFepzndgFFBDRI8cX6tTxz5qKx6bVF5070E04yUZWBePKWLjE6Skd
- XVdxyUNCea3Od4INbpkOUSbXPoNunn2ScDB2F8rdEU5WZr592uEgLGE53FUW4Z1b3sY2P21O1JrS
- fJYVm0+XV+57lZ43R1sL2C8Dc7PbBURrpX/Ex6al/b2KWFvcmAKTlFg/FAtaMer70VRLZtzeR5QS
- /j+ilnoxXODT+vYeaRzYxhA7ME+RJnPF6sjw+e5L+f31IznVARMBeoL8KhVrDfI71syrxAwlAPLg
- 6q50DUJ/LKfCpXo4x3966sg78xi/1hqCqW004UAZLM8pSvfirTSrsDw0jeCRgvUGD6p9QtQnjUr/
- wO0sn4JoanN4+0jas8WuRDd2VCuSqM8+402bWYyfUUd094dGqyfIQFo/hoLcqug2gm6cyfjQjK7W
- PrAGkFXgwf0EG7wULuk0ypUXRH/UJHHlQddicfn0GPt+GV8LoTjyg6YQb0DuolnPj2j0pquxO7In
- TKG/pVh3FjlEna328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XShARZ
- 9vYSlJKwZFtnkQTvt5lOkhTdYWC3hGh/enWuVUrSK5IVyyyYBae1bMaxUcm2JtGEFgiTo2mL2GT+
- jE3jpNg5TxIKQ5CH27w4lfuPXbdiKA3o2aK5vgzkbwwi6xHRLGaQzvpxYma+ge4az03jSAXwktbm
- Id5XjqHVJPXxdciaUtEez750NTp6ucmxnoJrziTeoz4f5zXaUNg52sbd45bqx/QAJzBPS77cElL6
- sfSS0A4EjMXDG/y75NSGEt79aYTrfhpiT0Bu8hfCR6jIa7953Ok/VAhXG2vtdTbvuiiCjbj5v/1v
- ARGY+chtR577qdgsPlps1YwNErjTHQFxXmCgDT55XWVaw0UD4stRCMnMvbM+fwPDWfV3dMI/jAco
- Xlk4qfMKuU+eqpTO3qMS1t4he0RoCW3hO7BjtSWdyCoXmFFf/wMxqADDbpfIr7r6xYqJY5tuQrhw
- YPJ9hF6FZpa+yy2wfdRU+avuuDD2BZB52Up2x46OE7xzlwDkeIzCoSxdZOa13by7OqLgEwGCtrvm
- UcVl8EHlnCTT0a29OE7N2yO9lKiDZbmsrJfJ9APy7MA7RTPVpZcMkAZ1upxH2zNCnT9WpHXtadBb
- vlh5A9YY3UrS8hmku+/5A51OiKUFo+26R3c3lf2/cavo40C4n+BTY0y/pweixbUmCTrSsY85HcPD
- bYeqV9kxa88/ilHM5WC3XA4QdD8a5eTDYHH0VbKvcq6D1fgqvVnNiwlbnipk+FoW5GAH8kI=
-
-
DELETED eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy.asc
Index: eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy.asc
==================================================================
--- eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy.asc
+++ eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJX1JQeAAoJEFAslq9JXcLZvMgQAJQ1QsszDIonrCXgSV78HpR+
-+fQQkemMyGkTKIkNz9Xd+6TwOxImLlUnPympAJ4KdlpXfpYisAAS9PxsKm1Xqdml
-D2xJ1rsirXEWmt7O04+xLB/V2M3esKtDnr4dXu3m9Fv8wyC9Vujrnrr8qiftLK5h
-RaQEVEAlScY67BLLQ9SX9qNYSDgA4WsLIY78pCJ6ml2eBiHRH+hJr8V1mKzxEqIK
-vYP2PJ+iOkuSHuKt/JML+4QOwvG3ISMQCaGKMMFLgdMwvZmesxIGQAK2zevbMawq
-LH0pdlf+XIqoRdKAhFixgpX6O8vTi0RGhGJd4uscQWpC16P/v34ZSgTsj+2ZngH9
-1aicJF6274IdQwXTvuqKy6nE27KZrHe33o+IVJQyDrtBRtpW4huFx47EEnlnDATC
-L0vQnMUEfAWCz3AG+ySV3lFHBPcNixK6xet4DjP9e5xml0fRyXt5VPgVYUwKB964
-4ibQYDku5IU6DsbEISb8r67Da3AMRHrYgez1OozpIlgAt65AD4CYdLh1ZpUhIurh
-pSIcFRnIfSav5xB0MuDtsBYTHUim8BhH3BPEM2a8PgLUhZzXoC+/JhH9H1QVJm3y
-glkM6sMCJQcD0jIbH2O3Xdfq7JYsK/XpZVeKISEy0+qx8wzsw19wGD2tsoUQKN1H
-PZzOU1KiLC4Y4D2AbIdv
-=UaG8
------END PGP SIGNATURE-----
ADDED packages/eagle/1.0/neutral/data1.0/data.eagle
Index: packages/eagle/1.0/neutral/data1.0/data.eagle
==================================================================
--- packages/eagle/1.0/neutral/data1.0/data.eagle
+++ packages/eagle/1.0/neutral/data1.0/data.eagle
@@ -0,0 +1,1139 @@
+###############################################################################
+#
+# data.eagle --
+#
+# Extensible Adaptable Generalized Logic Engine (Eagle)
+# Data Utility Package
+#
+# 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: Use our own namespace here because even though we do not directly
+# support namespaces ourselves, we do not want to pollute the global
+# namespace if this script actually ends up being evaluated in Tcl.
+#
+namespace eval ::Eagle {
+ #
+ # NOTE: This procedure is used to report errors during the various data
+ # processing operations. In "strict" mode, these errors are always
+ # fatal; otherwise, the errors are kept in a global "errors" variable
+ # for later reporting.
+ #
+ proc report { {message ""} {data ""} {strict 0} } {
+ if {$strict} then {
+ error [list message $message data $data]
+ } else {
+ lappend ::errors [list message $message data $data]
+
+ if {[lindex [info level -1] 0] ne "fail"} then {
+ if {[string length $message] > 0} then {
+ host result Error [appendArgs \n "message: " $message \n]
+ }
+
+ if {[string length $data] > 0} then {
+ host result Error [appendArgs \n "data: " $data \n]
+ }
+ }
+ }
+ }
+
+ proc fail { {error ""} } {
+ report $error "" 0; # NOTE: Non-strict, report only.
+
+ if {[string length $error] > 0} then {
+ putsStdout $error
+ }
+
+ if {[info exists ::usage]} then {
+ putsStdout $::usage
+ }
+
+ error $error
+ }
+
+ proc getArchitecture {} {
+ if {[info exists ::tcl_platform(machine)] && \
+ [string length $::tcl_platform(machine)] > 0} then {
+ #
+ # NOTE: Check for the "amd64" (i.e. "x64") architecture.
+ #
+ if {$::tcl_platform(machine) eq "amd64"} then {
+ return x64
+ }
+
+ #
+ # NOTE: Check for the "ia32_on_win64" (i.e. "WoW64") architecture.
+ #
+ if {$::tcl_platform(machine) eq "ia32_on_win64"} then {
+ return x86
+ }
+
+ #
+ # NOTE: Check for the "ia64" architecture.
+ #
+ if {$::tcl_platform(machine) eq "ia64"} then {
+ return ia64
+ }
+
+ #
+ # NOTE: Check for the "intel" (i.e. "x86") architecture.
+ #
+ if {$::tcl_platform(machine) eq "intel"} then {
+ return x86
+ }
+
+ #
+ # NOTE: We do not support this architecture.
+ #
+ putsStdout [appendArgs "Machine \"" $::tcl_platform(machine) \
+ "\" is unsupported."]
+
+ return unknown
+ }
+
+ putsStdout [appendArgs "Machine detection failed."]
+
+ return none
+ }
+
+ #
+ # NOTE: With the native library pre-loading feature and a proper application
+ # local deployment of System.Data.SQLite, as shown here:
+ #
+ # * \System.Data.SQLite.dll (managed-only core assembly)
+ # * \x86\SQLite.Interop.dll (x86 native interop assembly)
+ # * \x64\SQLite.Interop.dll (x64 native interop assembly)
+ #
+ # -OR-
+ #
+ # * \System.Data.SQLite.dll (managed-only core assembly)
+ # * \x86\sqlite3.dll (x86 native library)
+ # * \x64\sqlite3.dll (x64 native library)
+ #
+ # Using this procedure is no longer necessary.
+ #
+ proc setupForSQLite { path } {
+ #
+ # NOTE: The toolPath is the directory where the caller is running from.
+ #
+ set toolPath $path
+
+ putsStdout [appendArgs "Tool path is \"" $toolPath "\"."]
+
+ #
+ # NOTE: The externalsPath is the parent of the application root directory,
+ # which should be the Externals directory (i.e. the one containing
+ # the "sqlite3" and "System.Data.SQLite" directories). If this is
+ # not the case, append "Externals" to the directory and try there.
+ #
+ set externalsPath [file dirname $toolPath]
+
+ if {[file tail $externalsPath] ne "Externals"} then {
+ set externalsPath [file join $externalsPath Externals]
+ }
+
+ putsStdout [appendArgs "Externals path is \"" $externalsPath "\"."]
+
+ #
+ # NOTE: This is the list of file names we need to copy into the
+ # application binary directory. Currently, this includes the
+ # "sqlite3.dll" and "System.Data.SQLite.dll" files, which are
+ # necessary when using SQLite from Eagle.
+ #
+ set fileNames [list \
+ [file join $externalsPath sqlite3 [getArchitecture] sqlite3.dll] \
+ [file join $externalsPath System.Data.SQLite System.Data.SQLite.dll]]
+
+ #
+ # NOTE: The binaryPath is the directory where the application is running
+ # from.
+ #
+ set binaryPath [info binary]
+
+ putsStdout [appendArgs "Binary path is \"" $binaryPath "\"."]
+
+ #
+ # NOTE: Attempt to copy each of the files we need to the application
+ # binary directory. Hopefully, the CLR will be able to load them
+ # from there.
+ #
+ foreach fileName $fileNames {
+ if {![file exists $fileName]} then {
+ #
+ # NOTE: It seems the source file does not exist, skip it.
+ #
+ putsStdout [appendArgs "File \"" $fileName "\" does not exist."]
+
+ continue
+ }
+
+ set justFileName [file tail $fileName]
+ set newFileName [file join $binaryPath $justFileName]
+
+ if {$justFileName eq "sqlite3.dll"} then {
+ set magic 0
+ set error null
+
+ if {![object invoke Eagle._Components.Private.FileOps \
+ CheckPeFileArchitecture $fileName magic error]} then {
+ #
+ # NOTE: The "sqlite3.dll" file does not match the current operating
+ # system architecture (e.g. 32-bit DLL on 64-bit Windows).
+ #
+ fail [object invoke $error ToString]
+ } else {
+ putsStdout [appendArgs "File \"" $fileName "\" PE magic OK (" \
+ [string format "0x{0:X}" $magic] ")."]
+ }
+ }
+
+ if {![file exists $newFileName]} then {
+ #
+ # NOTE: The destination file does not exist, copy it.
+ #
+ file copy $fileName $newFileName
+
+ putsStdout [appendArgs "Copied \"" $fileName "\" to \"" \
+ $newFileName "\"."]
+ } else {
+ #
+ # NOTE: It seems the destination file already exists, skip it.
+ #
+ putsStdout [appendArgs "File \"" $newFileName "\" exists."]
+ }
+ }
+ }
+
+ proc showTime { name script } {
+ putsStdout [appendArgs "\n\nStarted " $name " at " \
+ [clock format [clock seconds]] .]
+
+ set elapsed [time {uplevel 1 $script}]
+
+ putsStdout [appendArgs "\n\nStopped " $name " at " \
+ [clock format [clock seconds]] .]
+
+ putsStdout [appendArgs "Completed in " \
+ $elapsed .]
+ }
+
+ proc haveChannel { name } {
+ if {![info exists ::haveChannel($name)]} then {
+ set ::haveChannel($name) \
+ [expr {[lsearch -exact [file channels] $name] != -1}]
+ }
+
+ return $::haveChannel($name)
+ }
+
+ proc putsStdout { args } {
+ #
+ # NOTE: Is the 'stdout' channel available?
+ #
+ if {[haveChannel stdout]} then {
+ #
+ # NOTE: Do we need to emit a trailing newline?
+ #
+ if {[llength $args] == 2 && \
+ [lindex $args 0] eq "-nonewline"} then {
+ #
+ # NOTE: Output the second argument with no newline.
+ #
+ catch {
+ puts -nonewline stdout [lindex $args 1]
+ flush stdout
+ }
+ } else {
+ #
+ # NOTE: Output the first argument with a newline.
+ #
+ catch {
+ puts stdout [lindex $args 0]
+ flush stdout
+ }
+ }
+ } else {
+ #
+ # HACK: Since there is no 'stdout' channel, this procedure is
+ # totally useless; therefore, we simply redefine it to do
+ # nothing.
+ #
+ proc putsStdout { args } {}
+ }
+ }
+
+ proc readBadFile { fileName {readProc readFile} } {
+ #
+ # HACK: This "text" file (as exported by MySQL) has a bad mixture of
+ # utf-8 and windows-1252 code points in it. At a bare minimum,
+ # we want to change the utf-8 code points that are used in the
+ # data as column and row delimiters and change them to valid
+ # windows-1252 code points.
+ #
+ return [string map [list \xC3\xBF \xFF \xC3\xBE \xFE] \
+ [$readProc $fileName]]
+ }
+
+ #
+ # WARNING: Do not use this procedure unless you know exactly what it does.
+ #
+ proc readUtf8File { fileName } {
+ set file_id [open $fileName RDONLY]
+ fconfigure $file_id -encoding utf-8 -translation auto
+ set result [read $file_id]
+ close $file_id
+ return $result
+ }
+
+ proc executeSQLite { fileName sql {strict 0} } {
+ try {
+ set connection [sql open -type SQLite \
+ [subst {Data Source=${fileName}}]]
+
+ if {[catch {sql execute $connection $sql} error] != 0} then {
+ report [appendArgs "sql statement error: " $error] \
+ [list $sql] $strict
+ }
+ } finally {
+ if {[info exists connection]} then {
+ sql close $connection; unset connection
+ }
+ }
+ }
+
+ proc scanAsciiChars {
+ fileName {readProc readFile} {startIndex 0} {skip ""} {strict 0} } {
+ #
+ # NOTE: Read all the data from the file into memory using the
+ # specified procedure.
+ #
+ # BUGFIX: *PERF* Use a real System.String object here (via an
+ # opaque object handle) and query each byte in the loop
+ # below as necessary. This prevents the whole string
+ # from being needlessly copied back and forth in memory
+ # repeatedly (i.e. during command invocation).
+ #
+ set data [object create -alias String [$readProc $fileName]]
+ set length [$data Length]
+ set chunk 1024
+
+ putsStdout [appendArgs "Scanning " $length " bytes of data (" \
+ $chunk " bytes per chunk)...\n"]
+
+ for {set index $startIndex} {$index < $length} {incr index} {
+ #
+ # NOTE: Grab the byte value of the specified "character" in
+ # the string from the opaque object handle.
+ #
+ set value [string ordinal [$data get_Chars $index] 0]
+
+ if {[lsearch -integer $skip $value] != -1} then {
+ continue
+ }
+
+ if {$value < 32 || $value == 127} then {
+ report [appendArgs "found control character " $value " (" \
+ [string format "0x{0:X}" $value] ") at index " $index] "" \
+ $strict
+ } elseif {$value > 126} then {
+ report [appendArgs "found bad character " $value " (" \
+ [string format "0x{0:X}" $value] ") at index " $index] "" \
+ $strict
+ }
+
+ if {$index % $chunk == 0} then {
+ putsStdout -nonewline 0
+ }
+ }
+ }
+
+ proc importDelimited {
+ fileName tableName {readProc readFile} {columnDelimiter \t}
+ {rowDelimiter \r\n} {strict 0} } {
+ #
+ # NOTE: Read all the data from the file into memory using the
+ # specified procedure.
+ #
+ # BUGFIX: *PERF* Use a real System.String object here (via an
+ # opaque object handle) and query each byte in the loop
+ # below as necessary. This prevents the whole string
+ # from being needlessly copied back and forth in memory
+ # repeatedly (i.e. during command invocation).
+ #
+ set data [object create -alias String [$readProc $fileName]]
+
+ #
+ # HACK: Check for a detached header file. This should contain
+ # exactly one row (including the trailing row delimter)
+ # with just the column names [separated by the column
+ # delimiter].
+ #
+ set headerFileName [file join [file dirname $fileName] \
+ [appendArgs header_ [file tail $fileName]]]
+
+ if {[file exists $headerFileName]} then {
+ putsStdout [appendArgs "Found detached header file \"" \
+ $headerFileName "\" for data file \"" $fileName \
+ "\", reading..."]
+
+ set headerData [object create -alias String [$readProc \
+ $headerFileName]]
+ }
+
+ #
+ # NOTE: Split the data using the row delimiter. We use the
+ # -string option here to allow for the use of a
+ # multi-character row delimiters. For data containing
+ # literal cr/lf characters, a non-cr/lf row delimiter
+ # must be used.
+ #
+ set rowDelimiters [object create -alias String\[\] 1]
+ $rowDelimiters SetValue $rowDelimiter 0
+ set lines [$data -create -alias Split $rowDelimiters None]
+
+ #
+ # NOTE: Determine how many rows of data there are. There must
+ # be more than zero to continue.
+ #
+ set rowCount [$lines Length]
+
+ #
+ # NOTE: We cannot proceed if there are no rows of data.
+ #
+ if {$rowCount == 0} then {
+ fail "no rows of data"
+ }
+
+ #
+ # NOTE: If we read the header data from the detached header file,
+ # use it; otherwise, grab the first line of the data. This
+ # line must be the header line (i.e. it must contain the
+ # column names and nothing else).
+ #
+ if {[info exists headerData]} then {
+ set headerLine [$headerData ToString]
+
+ #
+ # NOTE: All data rows are actually data; therefore, start on
+ # the first row.
+ #
+ set rowIndex 0
+ } else {
+ set headerLine [$lines GetValue 0]
+
+ #
+ # NOTE: The first data row is really the header line; therefore,
+ # start on the second row.
+ #
+ set rowIndex 1
+ }
+
+ #
+ # NOTE: We cannot proceed if the header line is empty.
+ #
+ if {[string length $headerLine] == 0} then {
+ fail "invalid file header"
+ }
+
+ putsStdout [appendArgs "\n\nAttempting to import " $rowCount \
+ " rows starting at index " $rowIndex "...\n"]
+
+ #
+ # NOTE: Unquote the column name (i.e. removes single and
+ # double quotation marks). Technically, this may
+ # be too liberal since it will remove all leading
+ # and trailing single and double quotes; however,
+ # these are the column names, not data, and should
+ # not contain any single or double quotes.
+ #
+ set unquote [list [list x] { return [string trim $x '\"] }]
+
+ #
+ # NOTE: Split the header line using the column delimiter.
+ # We use the -string option here to allow for the
+ # use of a multi-character column delimiter. For
+ # data containing literal tab characters, a non-tab
+ # column delimiter must be used.
+ #
+ set headerColumns [map \
+ [split $headerLine $columnDelimiter -string] \
+ {apply $unquote}]
+
+ set columnCount [llength $headerColumns]
+
+ #
+ # NOTE: We cannot proceed if there are no column names.
+ #
+ if {$columnCount == 0} then {
+ fail "no columns in header"
+ }
+
+ #
+ # NOTE: Using the table name, access the in-memory table
+ # from the calling context. By convention, the
+ # variable name will be "_rows".
+ #
+ upvar 1 [appendArgs $tableName _rows] table
+
+ #
+ # NOTE: Set the necessary metadata used by the export
+ # procedure into the table array.
+ #
+ set table(columns) $headerColumns
+ set table(imported) 0
+ set table(startIndex) $rowIndex
+
+ #
+ # NOTE: There is no loop initializer here, see above.
+ #
+ for {} {$rowIndex < $rowCount} {incr rowIndex} {
+ #
+ # NOTE: Grab the previous line of data, if available.
+ #
+ if {$rowIndex > 0} then {
+ set previousLine [$lines GetValue [expr {$rowIndex - 1}]]
+ } else {
+ set previousLine ""
+ }
+
+ #
+ # NOTE: Grab the current line of data.
+ #
+ set line [$lines GetValue $rowIndex]
+
+ #
+ # NOTE: Is the current line of data empty?
+ #
+ if {[string length $line] == 0} then {
+ #
+ # NOTE: We do not care if the final row of data is
+ # empty.
+ #
+ if {$rowIndex + 1 < $rowCount} then {
+ #
+ # NOTE: An empty row of data could indicate a corrupt
+ # data dump; however, it is almost always safe
+ # to simply ignore blank lines.
+ #
+ report [appendArgs "row #" $rowIndex " is empty"] \
+ [list previous $previousLine] $strict
+ }
+
+ continue
+ }
+
+ #
+ # NOTE: Split the current line using the column delimiter.
+ # We use the -string option here to allow for the
+ # use of a multi-character column delimiter. For
+ # data containing literal tab characters, a non-tab
+ # column delimiter must be used.
+ #
+ set columns [split $line $columnDelimiter -string]
+ set count [llength $columns]
+
+ #
+ # NOTE: Did we find some columns in the current line of
+ # data? Given the check for an empty line of data
+ # above, this should almost always succeed.
+ #
+ if {$count == 0} then {
+ #
+ # NOTE: A row of data with no columns could indicate a
+ # corrupt data dump.
+ #
+ report [appendArgs "row #" $rowIndex " has no columns"] \
+ [list previous $previousLine current $line] $strict
+
+ continue
+ }
+
+ #
+ # NOTE: Does the current line of data contain the correct
+ # number of columns (based on the header)? If the
+ # data dump is subtly corrupted in some way, this
+ # is the most likely error to be seen.
+ #
+ if {$count != $columnCount} then {
+ #
+ # NOTE: A row of data with an incorrect number of columns
+ # almost certainly indicates at least some level of
+ # data dump corruption. We can ignore it and proceed;
+ # however, each of these errors should be individually
+ # investigated at the very least.
+ #
+ report [appendArgs "row #" $rowIndex " has " $count \
+ " columns, expected " $columnCount] [list current $line] $strict
+
+ continue
+ }
+
+ #
+ # NOTE: Process each column value for this row and add it
+ # to the in-memory table.
+ #
+ set columnIndex 0
+
+ for {} {$columnIndex < $count} {incr columnIndex} {
+ set columnName [lindex $headerColumns $columnIndex]
+ set columnValue [lindex $columns $columnIndex]
+
+ #
+ # NOTE: Is the first character a single or double quote?
+ #
+ if {[string index $columnValue 0] eq "'" || \
+ [string index $columnValue 0] eq "\""} then {
+ #
+ # NOTE: Ok, remove the first character.
+ #
+ set columnValue [string range $columnValue 1 end]
+ }
+
+ #
+ # NOTE: Is the last character a single or double quote?
+ #
+ if {[string index $columnValue end] eq "'" || \
+ [string index $columnValue end] eq "\""} then {
+ #
+ # NOTE: Ok, remove the last character.
+ #
+ set columnValue [string range $columnValue 0 end-1]
+ }
+
+ set table($rowIndex,$columnName) $columnValue
+ }
+
+ incr table(imported)
+ putsStdout -nonewline .
+ }
+
+ set table(count) $table(imported)
+ }
+
+ proc exportFixedLength {
+ tableName fileName fields {maps ""} {regsubs ""} {strict 0} } {
+ #
+ # NOTE: Using the table name, access the in-memory table
+ # from the calling context. By convention, the
+ # variable name will be "_rows".
+ #
+ upvar 1 [appendArgs $tableName _rows] table
+
+ set headerColumns $table(columns)
+ set columnCount [llength $headerColumns]
+
+ #
+ # NOTE: So far, we have not exported any rows.
+ #
+ set table(exported) 0
+
+ #
+ # NOTE: Grab the necessary metadata from the table array.
+ #
+ set rowCount $table(count)
+ set startIndex $table(startIndex)
+ set rowIndex $startIndex
+
+ putsStdout [appendArgs "\n\nAttempting to export " $rowCount \
+ " rows starting at index " $rowIndex "...\n"]
+
+ #
+ # NOTE: Process each row in the passed-in array. There is no
+ # loop initializer here, see above.
+ #
+ set data ""
+
+ for {} {$rowIndex < $rowCount + $startIndex} {incr rowIndex} {
+ #
+ # NOTE: Start out with an empty row value. After all the fields
+ # are processed, this will be added to the overall data block
+ # to export.
+ #
+ set rowValue ""
+
+ #
+ # NOTE: Process each field in the passed-in list.
+ #
+ set fieldIndex 0
+
+ for {} {$fieldIndex < [llength $fields]} {incr fieldIndex} {
+ #
+ # NOTE: What is the length of this row so far?
+ #
+ set rowLength [string length $rowValue]
+
+ #
+ # NOTE: Grab the field [definition] from the list.
+ #
+ set field [lindex $fields $fieldIndex]
+
+ #
+ # NOTE: Make sure the field has the required elements.
+ #
+ if {[llength $field] < 3} then {
+ report [appendArgs \
+ "field #" $fieldIndex " has " [llength $field] \
+ " elements, expected at least 3"] "" $strict
+
+ continue
+ }
+
+ #
+ # NOTE: Extract and validate the field identifier. This element is
+ # always required and must be a valid integer.
+ #
+ set fieldId [string trim [lindex $field 0]]
+
+ if {![string is integer -strict $fieldId]} then {
+ report [appendArgs \
+ "field #" $fieldIndex " has an invalid identifier \"" \
+ $fieldId \"] "" $strict
+
+ continue
+ }
+
+ #
+ # NOTE: Extract and validate the field name. This element is
+ # always required.
+ #
+ set fieldName [string trim [lindex $field 1]]
+
+ if {[string length $fieldName] == 0} then {
+ report [appendArgs \
+ "field #" $fieldIndex " has an empty name"] "" $strict
+
+ continue
+ }
+
+ #
+ # NOTE: Extract and validate the field width. This element is
+ # always required and must be a valid integer greater than
+ # zero.
+ #
+ set fieldWidth [string trim [lindex $field 2]]
+
+ if {![string is integer -strict $fieldWidth]} then {
+ report [appendArgs \
+ "field #" $fieldIndex " has an invalid width \"" \
+ $fieldWidth \"] "" $strict
+
+ continue
+ }
+
+ #
+ # NOTE: The field width must be positive and greater than zero.
+ #
+ if {$fieldWidth <= 0} then {
+ report [appendArgs \
+ "field #" $fieldIndex " has width \"" $fieldWidth \
+ "\", which is less than or equal to zero"] "" $strict
+
+ continue
+ }
+
+ #
+ # NOTE: Extract and validate the field start. This element is
+ # optional; if specified, it must be an integer.
+ #
+ set fieldStart [string trim [lindex $field 3]]
+
+ if {[string length $fieldStart] == 0} then {
+ set fieldStart $rowLength
+ }
+
+ if {![string is integer -strict $fieldStart]} then {
+ report [appendArgs \
+ "field #" $fieldIndex " has an invalid start \"" \
+ $fieldStart \"] "" $strict
+
+ continue
+ }
+
+ #
+ # NOTE: The field start cannot occur before the current position in
+ # the row being built (i.e. fields are always processed in the
+ # order they occur in the list provided by the caller).
+ #
+ if {$fieldStart < $rowLength} then {
+ report [appendArgs \
+ "field #" $fieldIndex " cannot start at \"" $fieldStart \
+ "\", already beyond that point"] "" $strict
+
+ continue
+ }
+
+ #
+ # NOTE: Extract and validate the field alignment. This element is
+ # optional; if specified, it must be either "left" or "right".
+ #
+ set fieldAlignment [string trim [lindex $field 4]]
+
+ if {[string length $fieldAlignment] == 0} then {
+ set fieldAlignment right
+ }
+
+ if {$fieldAlignment ni [list left right]} then {
+ report [appendArgs \
+ "field #" $fieldIndex " has an invalid alignment \"" \
+ $fieldAlignment "\", must be \"left\" or \"right\""] "" \
+ $strict
+
+ continue
+ }
+
+ #
+ # NOTE: Extract and validate the field type. This element is
+ # optional; if specified, it must be either "string",
+ # "number", or "datetime".
+ #
+ set fieldType [string trim [lindex $field 5]]
+
+ if {[string length $fieldType] == 0} then {
+ set fieldType string
+ }
+
+ if {$fieldType ni [list string number datetime]} then {
+ report [appendArgs \
+ "field #" $fieldIndex " has an invalid type \"" $fieldType \
+ "\", must be \"string\", \"number\", or \"datetime\""] "" \
+ $strict
+
+ continue
+ }
+
+ #
+ # NOTE: Extract and validate the field format. This element is
+ # optional.
+ #
+ set fieldFormat [lindex $field 6]; # NOTE: No trim.
+
+ #
+ # NOTE: Search for the column in the list of columns. If it cannot
+ # be found, use an empty string for the column name and value.
+ # We cannot simply skip the column because the format string
+ # may simply be a literal string that does not require the
+ # column value.
+ #
+ set columnIndex [lsearch -exact $headerColumns $fieldName]
+
+ if {$columnIndex != -1} then {
+ set columnName [lindex $headerColumns $columnIndex]
+ set columnValue $table($rowIndex,$columnName)
+ } else {
+ set columnName ""
+ set columnValue ""
+ }
+
+ #
+ # HACK: Perform any replacements specified by the caller. This is
+ # done in two phases. Typically, the first phase is used to
+ # escape characters (e.g. by converting them to HTML entities)
+ # and the second phase is [optionally] used to undo any double
+ # escapes that may have been created during the first phase.
+ #
+ if {[llength $maps] > 0} then {
+ foreach map $maps {
+ if {[llength $map] > 0} then {
+ set columnValue [string map $map $columnValue]
+ }
+ }
+ }
+
+ #
+ # HACK: Perform any regular expression replacements specified by the
+ # caller.
+ #
+ if {[llength $regsubs] > 0} then {
+ foreach regsub $regsubs {
+ #
+ # NOTE: Each element in the list must have exactly 2 elements.
+ # The first element must be the regular expression. The
+ # second element must be the replacement pattern.
+ #
+ if {[llength $regsub] == 2} then {
+ regsub -all -- [lindex $regsub 0] $columnValue \
+ [lindex $regsub 1] columnValue
+ }
+ }
+ }
+
+ #
+ # NOTE: Check if an explicit format string was specified. If so,
+ # use the appropriate formatting command for the data type.
+ #
+ if {[string length $fieldFormat] > 0} then {
+ switch -exact -- $fieldType {
+ string {
+ set columnValue [object invoke String Format \
+ $fieldFormat $columnValue]
+ }
+ number {
+ set columnValue [format $fieldFormat $columnValue]
+ }
+ datetime {
+ if {[string length $columnValue] > 0 && \
+ ![string is integer -strict $columnValue]} then {
+ #
+ # NOTE: The value is not an integer; therefore,
+ # try to scan it as a date and/or time.
+ #
+ set columnValue [clock scan $columnValue]
+ }
+
+ set columnValue [clock format $columnValue \
+ -format $fieldFormat]
+ }
+ default {
+ report [appendArgs \
+ "field #" $fieldIndex " has bad type \"" \
+ $fieldAlignment \"] "" $strict
+
+ continue
+ }
+ }
+ }
+
+ #
+ # NOTE: Check the formatted column length against the field width.
+ # If the formatted column length is greater, it must be
+ # truncated. Otherwise, if the formatted column length is
+ # less, it must be padded according to the field alignment.
+ #
+ set columnLength [string length $columnValue]
+
+ if {$columnLength > $fieldWidth} then {
+ #
+ # NOTE: Truncate the string; otherwise, it will not fit within
+ # the field.
+ #
+ if {$fieldAlignment eq "left"} then {
+ set columnValue [string range $columnValue \
+ [expr {$columnLength - $fieldWidth}] end]
+ } else {
+ set columnValue [string range $columnValue \
+ 0 [expr {$fieldWidth - 1}]]
+ }
+
+ report [appendArgs \
+ "column \"" $columnName "\" value at row #" $rowIndex \
+ " (length " $columnLength ") exceeds width of field #" \
+ $fieldIndex " (width " $fieldWidth "), truncated"] "" \
+ $strict
+ } else {
+ set padding [string repeat " " \
+ [expr {$fieldWidth - $columnLength}]]
+
+ if {$fieldAlignment eq "left"} then {
+ set columnValue [appendArgs $columnValue $padding]
+ } else {
+ set columnValue [appendArgs $padding $columnValue]
+ }
+ }
+
+ #
+ # NOTE: If this field starts at some point after the end of the
+ # row value built so far, pad it.
+ #
+ if {$fieldStart > $rowLength} then {
+ set padding [string repeat " " \
+ [expr {$fieldStart - $rowLength}]]
+ } else {
+ set padding ""
+ }
+
+ #
+ # NOTE: Append the necessary padding and the final column value
+ # to the row value.
+ #
+ append rowValue $padding $columnValue
+ }
+
+ #
+ # NOTE: Append the row value to the overall data block to export.
+ #
+ append data $rowValue
+
+ incr table(exported)
+ putsStdout -nonewline *
+ }
+
+ writeFile $fileName $data
+ }
+
+ proc exportSQLite {
+ tableName fileName {sql ""} {maps ""} {regsubs ""} {strict 0} } {
+ #
+ # NOTE: Export the in-memory table to the specified SQLite
+ # database file.
+ #
+ try {
+ set connection [sql open -type SQLite \
+ [subst {Data Source=${fileName}}]]
+
+ #
+ # NOTE: If custom SQL was specified, execute it against
+ # the database connection now.
+ #
+ if {[string length $sql] > 0} then {
+ sql execute $connection $sql
+ }
+
+ #
+ # NOTE: Using the table name, access the in-memory table
+ # from the calling context. By convention, the
+ # variable name will be "_rows".
+ #
+ upvar 1 [appendArgs $tableName _rows] table
+
+ set headerColumns $table(columns)
+ set columnCount [llength $headerColumns]
+
+ #
+ # NOTE: Wraps the column name in square brackets.
+ #
+ set wrap [list [list x] { return [appendArgs \[ $x \]] }]
+
+ #
+ # NOTE: Build the parameterized SQL statement to execute an
+ # INSERT (or UPDATE) of a single row.
+ #
+ set rowSql [appendArgs \
+ "INSERT OR REPLACE INTO \[" $tableName "\] (" \
+ [join [map $headerColumns {apply $wrap}] ,] ") VALUES(" \
+ [join [lrepeat $columnCount ?] ,] ");"]
+
+ #
+ # NOTE: Build the per-row script to evaluate for adding or
+ # updating a row in the database.
+ #
+ set script {eval sql execute -verbatim \
+ [list $connection] [list $rowSql] $columnParams}
+
+ #
+ # NOTE: So far, we have not exported any rows.
+ #
+ set table(exported) 0
+
+ #
+ # NOTE: Grab the necessary metadata from the table array.
+ #
+ set rowCount $table(count)
+ set startIndex $table(startIndex)
+ set rowIndex $startIndex
+
+ putsStdout [appendArgs "\n\nAttempting to export " $rowCount \
+ " rows starting at index " $rowIndex "...\n"]
+
+ #
+ # NOTE: Process each row in the passed-in array. There is no loop
+ # initializer here, see above.
+ #
+ for {} {$rowIndex < $rowCount + $startIndex} {incr rowIndex} {
+ set columnParams [list]
+
+ #
+ # NOTE: Process each column value for this row and add it to the
+ # list of parameters for the SQL statement to execute.
+ #
+ set columnIndex 0
+
+ for {} {$columnIndex < $columnCount} {incr columnIndex} {
+ set columnName [lindex $headerColumns $columnIndex]
+ set columnValue $table($rowIndex,$columnName)
+
+ #
+ # HACK: Perform any replacements specified by the caller. This is
+ # done in two phases. Typically, the first phase is used to
+ # escape characters (e.g. by converting them to HTML entities)
+ # and the second phase is [optionally] used to undo any double
+ # escapes that may have been created during the first phase.
+ #
+ if {[llength $maps] > 0} then {
+ foreach map $maps {
+ if {[llength $map] > 0} then {
+ set columnValue [string map $map $columnValue]
+ }
+ }
+ }
+
+ #
+ # HACK: Perform any regular expression replacements specified by the
+ # caller.
+ #
+ if {[llength $regsubs] > 0} then {
+ foreach regsub $regsubs {
+ #
+ # NOTE: Each element in the list must have exactly 2 elements.
+ # The first element must be the regular expression. The
+ # second element must be the replacement pattern.
+ #
+ if {[llength $regsub] == 2} then {
+ regsub -all -- [lindex $regsub 0] $columnValue \
+ [lindex $regsub 1] columnValue
+ }
+ }
+ }
+
+ #
+ # HACK: Make dates conform to the format needed by SQLite.
+ #
+ if {[regexp -- {^\d{4}/\d{1,2}/\d{1,2}$} $columnValue]} then {
+ set dateTime [object invoke -alias DateTime Parse $columnValue]
+ set columnValue [$dateTime ToString yyyy-MM-dd]
+ }
+
+ #
+ # NOTE: Make sure to omit the parameter value if the column value
+ # needs to be a literal NULL.
+ #
+ set columnParam [list [appendArgs param $columnIndex] String]
+
+ if {$columnValue ne "NULL"} then {
+ lappend columnParam $columnValue
+ }
+
+ #
+ # NOTE: Add the parameter for this column to the list of parameters
+ # to pass to the command.
+ #
+ lappend columnParams $columnParam
+ }
+
+ #
+ # NOTE: Evaluate the per-row script used to actually insert or
+ # update a row in the database. Catch and report on any
+ # errors we encounter.
+ #
+ if {[catch $script error] != 0} then {
+ report [appendArgs "sql statement error: " $error] \
+ [list $rowSql $columnParams] $strict
+ } else {
+ #
+ # NOTE: We successfully imported another row.
+ #
+ incr table(exported)
+ }
+
+ putsStdout -nonewline *
+ }
+ } finally {
+ if {[info exists connection]} then {
+ sql close $connection; unset connection
+ }
+ }
+ }
+
+ #
+ # NOTE: Provide the Eagle library package to the interpreter.
+ #
+ package provide Eagle.Data \
+ [expr {[isEagle] ? [info engine PatchLevel] : "1.0"}]
+}
+
ADDED packages/eagle/1.0/neutral/data1.0/data.eagle.asc
Index: packages/eagle/1.0/neutral/data1.0/data.eagle.asc
==================================================================
--- packages/eagle/1.0/neutral/data1.0/data.eagle.asc
+++ packages/eagle/1.0/neutral/data1.0/data.eagle.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJX1JQWAAoJEFAslq9JXcLZnPcQAKjLrT+W439ps4nNxAMcCcgC
+5p6UoMXwr9+34ffTi41jK3tN5cptUOe8PKhROG6FTJrJclNZFqkRJagVGKdcs3ED
+ykGKDLOSwI547jJNGKqfhrd199GsVr+cmhEI64+6j9U5RltKQtF+whJx89werTWd
+tRPedr09ET4QOW/W66Q0s7UjljEZZqkz2ErepBFhPLWbCWroYi6H795FxPA6nAlO
+15PlR9z1p8DAF4YpKC4zRK0NMUtEh8OnH1hJQ3E+n/1gJpvYV4el2hA7Z+uZ07xP
+NHT9nSKbJ8EwmVYy3+HCBduMp0X81VzMXM2kyzpeZF/tSxwi23SGZtXmc75icRa2
+iRj93h1jqhnB5+1OF7C+ezC3JesVPyngNXydPPOmKNi9AqRgUOSBRSzitBBFqE5C
+Pjl/rtzDOtdrcifv1+iRYwvF3W/EGNL2b8EY+g7/rYNUFrOcEaGMWx3ID/dw4xs1
+XeEWTi0lfuiyFs6CuleCGOAqV+IgU2se4mWZ0t2A/ZihQQ9FuektGCpAeeqBqIai
+KEgtZP2Chq8JBArlWc4qnMckdGyMLeJzp4ecBnWOI2yx+K0bxTHn0QxnLTvKUT0C
+qr1S0l1E3TwnHiNLIuS6soDPUHevgDDSJEARiLIcT7U5N9q0pbdJCCJKDqoK1NQ+
+0W3DKj684Zcn+SYzGDQ3
+=UI7f
+-----END PGP SIGNATURE-----
ADDED packages/eagle/1.0/neutral/data1.0/data.eagle.harpy
Index: packages/eagle/1.0/neutral/data1.0/data.eagle.harpy
==================================================================
--- packages/eagle/1.0/neutral/data1.0/data.eagle.harpy
+++ packages/eagle/1.0/neutral/data1.0/data.eagle.harpy
@@ -0,0 +1,68 @@
+
+
+
+ None
+ Mistachkin Systems
+ 53cac383-800a-4e1a-ac9f-54d79a848e29
+ SHA512
+ Script
+ 2016-08-23T04:09:36.0449687Z
+ -1.00:00:00
+ 0x9559f6017247e3e2
+
+ L+djNOnpJYT/bz7vxOhzZ8FRSSmlPAyfnec5kwDbh0TETAVpjy/GszmtGzI51+RsMGFNMdOYUkSi
+ uEKgkMmWcbZskJbZUKE2nnIqw91ZdVVpsA/9ODBD8aY7/FtT8QhrM1qLMF5TioldW7QwE/Ps+H7L
+ WzEsUSDRJVjbwtz1ENkKzaEr2Y+QNEY4s1wN9ngNYspG0roPG3Woq96z/orAR0RGlLD1t7uMCsqa
+ wGDazm8duiB29tj+cJs92Lx7OkYwIt7ssqCDfEly8f7yIicmtumTdqQgnq4Neg+XzTlc7GafjmQK
+ FZR4+di5A2KdWRdG4Mb1OURBtw5IGp4JTRGAgcmckTxsWmOpxGc5CNOVh1iUUzur0O/AMbOqzgsQ
+ zSmWKUGgVy6oRGqahIBmrdTlrdGNOCT5OmK22lLDpsWFwLTDrH4Tg9IJlchTf8yLF/t6VX+1+SN+
+ R3AZcqprO15EwjaxHGd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Bk16Vc1EsL7JRFhYOttGyEiGaMFZsHtdljxF
+ 76ZhP/bKWYR+zOFbOnXzPJ1T0xTorofv6MxOEJvQ1nT5MHwdgXaPDXbk71aXuJgiNLymaSvuXZUm
+ 7x3Dw9wOid9t0/5451QTOq0kbrdHAitVdcrcXKjzgg7NlccvAlncKP10JdsArJSFgdfZKp0=
+
+
ADDED packages/eagle/1.0/neutral/data1.0/data.eagle.harpy.asc
Index: packages/eagle/1.0/neutral/data1.0/data.eagle.harpy.asc
==================================================================
--- packages/eagle/1.0/neutral/data1.0/data.eagle.harpy.asc
+++ packages/eagle/1.0/neutral/data1.0/data.eagle.harpy.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJX1JQYAAoJEFAslq9JXcLZeJQQALuSwisANovxPGdhduKX0r+r
+E54ESvS08wGUsQTWvlb+SuvEhScTbtZevQXgXCX60CqFRYLbskeaMkZkNl8JeXks
+SoiD0OqEnuDMgOjF9CgnRTnsxK3y7jR4birycxH2IvVbS8TpTD/6Wl+A61zb0mwD
+9NB1R0DE6Ty0R4a5TDa6SWKRKwhE1hQOIm9X4ZGnL+zXYc90vBjeIaeYb9hlTDMU
+v6qvwok20JPaaOdDzNVVSDY25/p4q8HPsntTFBKEnlzjtMXoj2WhPpLi0uzFFRhI
+wpFpMeNVRUiQuEE0k5eHPFgSGzpEggObHEbEElPAySnWqvmCsEMdqqCDFKa0Rlkp
+go9Ab3YnXLQZcsm7NOM+uan+U0giglxWNY27+Lna6QpLGIg3UZsTFbpdpSVrCxMt
+zdOMfl+KYQt8NIvZwbX6OEURXYvgrJrIPQkrFH2LxgGT5Bx999ZFSSnyqjXN3Cb+
+XbJyoMWhuFY6dGkkCZLyitUz/esCn700EvVjmyKyM7gmUyPMSnVmQ3YNiY6GLF+6
+Pg2SJU6uFKsgSQoyHHzaJtrSyi2oA+Qu7KaqF/sfDcPPXTxrztwGn1xLhsHvFTiT
+F4+0Jj2+1iclj+STMDbkUcn5MZQS7JeP90Mr1UAvCWA3gDPA0ZyLgbVPddc7Kadj
+R+b87Ovem+vY4CKtpy7L
+=5Nek
+-----END PGP SIGNATURE-----
ADDED packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle
Index: packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle
==================================================================
--- packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle
+++ packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle
@@ -0,0 +1,20 @@
+###############################################################################
+#
+# pkgIndex.eagle --
+#
+# 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]} {return}
+if {![package vsatisfies [package provide Eagle] 1.0]} {return}
+
+package ifneeded Eagle.Data 1.0 [list source [file join $dir data.eagle]]
ADDED packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.asc
Index: packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.asc
==================================================================
--- packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.asc
+++ packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJX1JQcAAoJEFAslq9JXcLZZL0QAKPsxh3L1x5LYZ5r2KNO6hPZ
+P5T/7zFPyRLoIbqRvBdgeKMH4+yYlvYHVgPO4oiUNz9g03CZoh/GLZHt21twXVA2
+gzMlf68e1L2aNHpiqeR9LXbC1UpHPLFoCv28Gnk7F2UUk4cR/9CkcK38J2kMRNVD
+2sAWJM/bNsVJ3rz3A/b9dGIemAQZjZ4SRB3M1ecZaFqGo9wrhCGfMcDavoGHkR+7
+VX3dy3qvLWEEgnuBb10QdyAx2ORAry45UtrmuTUVFfQIk5f775vvefe5gxjKGNW3
++8eYPPuIwWMgx3VANL0J7xf7sOxuA0MjdQhCnpAV2aIIlhY07rEZtdsY65LNF68d
+hExh2fGQeVzAayM8/zl8Tcy8nnInQag8lDOcfOchd8gae+f34HJ5ENxUVCTZUrPz
+gNlQq5FQwUvAbv5jvozXqARlBdCSwYgMdxYzfOKDVN49h4wpsZ4L6AjmeMOQLGzh
+l3Uem+1ToOXrbw7VFx1xUKZnzjSFbSsSNiU+F1DIfrRV1x2wloyeze63nZRmZVtn
+3A96nqPEr0BdP6E0kEn1f8LEgCHGefBgq83e/O4PnvZl8BKfuM1VMRb4ohno6f0k
+SgX3eMpB00ADK8mFI/TO/jrz0X33SWxlNZQpa46qRAt6pny7np/3Dpirt8I4r+fK
+A2PxwRU+4e4Va3dz5/s1
+=8Sv6
+-----END PGP SIGNATURE-----
ADDED packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy
Index: packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy
==================================================================
--- packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy
+++ packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy
@@ -0,0 +1,68 @@
+
+
+
+ None
+ Mistachkin Systems
+ 092bc755-f131-430f-8c7e-6ce47756ec69
+ SHA512
+ Script
+ 2016-08-23T04:43:50.7227031Z
+ -1.00:00:00
+ 0x9559f6017247e3e2
+
+ qWSUmAwQawmj4AqAdy4DFQXAYAqZkikidSwK7BMz+pMiT0qSN/aiKnHq/yE3ERsVuZ1wwFlE6vOu
+ dRJ9TfPCZNoaeQuMZj7lNAxumG8d125mSTUEdzkU+FH/DXXV4VSlROPCmf3k/kzG+jkqfx2VUJAu
+ pkg7TqnqKDEWeYJoFMxKXmwxrSxui2g39EXqJoj7qBY7EVEQOpmAgspE13uD+8N08o1M8oor5jsm
+ Akb4X2zCRZ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Vaw0UD4stRCMnMvbM+fwPDWfV3dMI/jAco
+ Xlk4qfMKuU+eqpTO3qMS1t4he0RoCW3hO7BjtSWdyCoXmFFf/wMxqADDbpfIr7r6xYqJY5tuQrhw
+ YPJ9hF6FZpa+yy2wfdRU+avuuDD2BZB52Up2x46OE7xzlwDkeIzCoSxdZOa13by7OqLgEwGCtrvm
+ UcVl8EHlnCTT0a29OE7N2yO9lKiDZbmsrJfJ9APy7MA7RTPVpZcMkAZ1upxH2zNCnT9WpHXtadBb
+ vlh5A9YY3UrS8hmku+/5A51OiKUFo+26R3c3lf2/cavo40C4n+BTY0y/pweixbUmCTrSsY85HcPD
+ bYeqV9kxa88/ilHM5WC3XA4QdD8a5eTDYHH0VbKvcq6D1fgqvVnNiwlbnipk+FoW5GAH8kI=
+
+
ADDED packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy.asc
Index: packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy.asc
==================================================================
--- packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy.asc
+++ packages/eagle/1.0/neutral/data1.0/pkgIndex.eagle.harpy.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJX1JQeAAoJEFAslq9JXcLZvMgQAJQ1QsszDIonrCXgSV78HpR+
++fQQkemMyGkTKIkNz9Xd+6TwOxImLlUnPympAJ4KdlpXfpYisAAS9PxsKm1Xqdml
+D2xJ1rsirXEWmt7O04+xLB/V2M3esKtDnr4dXu3m9Fv8wyC9Vujrnrr8qiftLK5h
+RaQEVEAlScY67BLLQ9SX9qNYSDgA4WsLIY78pCJ6ml2eBiHRH+hJr8V1mKzxEqIK
+vYP2PJ+iOkuSHuKt/JML+4QOwvG3ISMQCaGKMMFLgdMwvZmesxIGQAK2zevbMawq
+LH0pdlf+XIqoRdKAhFixgpX6O8vTi0RGhGJd4uscQWpC16P/v34ZSgTsj+2ZngH9
+1aicJF6274IdQwXTvuqKy6nE27KZrHe33o+IVJQyDrtBRtpW4huFx47EEnlnDATC
+L0vQnMUEfAWCz3AG+ySV3lFHBPcNixK6xet4DjP9e5xml0fRyXt5VPgVYUwKB964
+4ibQYDku5IU6DsbEISb8r67Da3AMRHrYgez1OozpIlgAt65AD4CYdLh1ZpUhIurh
+pSIcFRnIfSav5xB0MuDtsBYTHUim8BhH3BPEM2a8PgLUhZzXoC+/JhH9H1QVJm3y
+glkM6sMCJQcD0jIbH2O3Xdfq7JYsK/XpZVeKISEy0+qx8wzsw19wGD2tsoUQKN1H
+PZzOU1KiLC4Y4D2AbIdv
+=UaG8
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe
Index: packages/tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe
==================================================================
--- packages/tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe
+++ packages/tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe
cannot compute difference between binary files
ADDED packages/tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe.asc
Index: packages/tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe.asc
==================================================================
--- packages/tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe.asc
+++ packages/tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJZWApqAAoJEFAslq9JXcLZWOgQAJ0P2QOQDgd8LBDsqhFwFfTk
+TyNHi3xRKb1TOtHhIRip5kgH9sn6jSE8VqMU8MJuKpPaWCaZraZ9CyL0PzMqF3gh
+u/8YFMW82evxcaVxue7BzNnha6YJyIXsLb6Uc0lDK8yU9szKm4qq/Y6czptij1Nl
+/dUswLLUwPN785jtC05MkJLVL32DvfatmoVAYHAS3Cvva0S6P/kEmAJC4G0wOyIK
+Rl7NpCOsq3re//LVbXc7dgZox6lS/fCwuqiQAK08Tbv8JxpCKJerNpFvXpBbEU4J
+n7HDcgc2QuKGwLPPmmnZvW6ymrrq0dFCa3tJQTDN+JmpgE8GddyNA9FQN+qtIA7i
+sV9FziRAN4whZxcA54Ev2nf0R8m4Mga4/x6sMN0WJUHkXWzi7gMvvu8/bC3U/Vfu
+iMLLTnIKcHUTuUS80AizJsU3BxEzWvcwxoSl08n4+jAdZoq0KAwHBOZ4AugYT6ap
+fYTb6IxOfQFfzMQo8vZ+IVB6n2t24x3hfK5RZsPRPxsybkPNmBhjsIyXkzf/wX3Q
+HIAb61vdNnf2+stNfjhtfNvMlOzt2RRjixC3fETfgSfSMjeXmupHD7ANDwZJXCQ7
+teBO92JGiYqZk8Emh6OdedxqYi5WI9RE5t2HhMlSq52hjlS3HvsnpDv2mUbL1BNx
+ph7yruPtktPzhGfN9SiG
+=Ezfd
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl
Index: packages/tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl
==================================================================
--- packages/tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl
+++ packages/tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl
@@ -0,0 +1,26 @@
+###############################################################################
+#
+# 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 HelloWorld 1.0 [list apply [list { dir } {
+ set command [list exec]
+ if {![isWindows]} then {lappend command mono}
+ lappend command [file join $dir HelloWorld.exe]
+ puts stdout [eval $command]
+ package provide HelloWorld 1.0
+}] $dir]
ADDED packages/tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl.asc
Index: packages/tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl.asc
==================================================================
--- packages/tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl.asc
+++ packages/tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJZWBTcAAoJEFAslq9JXcLZB7sQAIWnK+RKMFG58dAS83y3V3Pn
+p4iLIA3qihBH1PuBRqdNdyOdx3OtnAjX4sqaK+wb0cUYu0VuzkHWWw4bp5dFe1S7
+c+4I35rutxtXFtrszyHBbZ4PvNFkm40VL+ayoGsPCCLtXogHJkFaUg9ySR4UPDbW
+4kOJ9ScriUl+EPiyLHDYmS69EyVjuVJ2kyqTLVtyuQTv2woQfLTXuxkjBcdjeAwJ
+pU9HWqOP2caGhPMcPKMmWxhd3mMfqYQd3FFtJJl22k49bc9x48IFJoobaGjabWZf
+HkL7+kMdODExIdsrqGcbrztbghhdlgr2iDDKyc23pz9fLN6T7j/uR6wL7HgT5WA2
+yv0HU0IqmuqRI2KlCOkLGzw6v1XFsDtUT+83VKFY05zSIV3B1S8yHVlZ3/I2eyOK
++O3suL/wfeIPNfM0M6/nT6tSo9A7fc2ZM6XCOqU2bzAK/N/iqSKi2/0ePvBfC5wL
+iT20acFgDpAVyTmtGeQeZ6CIJIcsMnFQ66uALBk0NS79wfJqxra2fdrLXtauIjP4
+As8BL8gHBbIqY/OOI9BHpIwsnen4QLZAHwc0uMH9VwB9hIG4IeYOF9qcIAS3Mea/
+TYiDH3HovgDZqvmFvamneNO7IMdkiKEBEa78KOvveJuxSCrNxqccmCtOoRP/oD44
+fYzxOCEFXyTuOKpinIRk
+=ogyF
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/neutral/tcllib1.15/aes/aes.tcl
Index: packages/tcl/8.4/neutral/tcllib1.15/aes/aes.tcl
==================================================================
--- packages/tcl/8.4/neutral/tcllib1.15/aes/aes.tcl
+++ packages/tcl/8.4/neutral/tcllib1.15/aes/aes.tcl
@@ -0,0 +1,628 @@
+# aes.tcl -
+#
+# Copyright (c) 2005 Thorsten Schloermann
+# Copyright (c) 2005 Pat Thoyts
+# Copyright (c) 2013 Andreas Kupries
+#
+# A Tcl implementation of the Advanced Encryption Standard (US FIPS PUB 197)
+#
+# AES is a block cipher with a block size of 128 bits and a variable
+# key size of 128, 192 or 256 bits.
+# The algorithm works on each block as a 4x4 state array. There are 4 steps
+# in each round:
+# SubBytes a non-linear substitution step using a predefined S-box
+# ShiftRows cyclic transposition of rows in the state matrix
+# MixColumns transformation upon columns in the state matrix
+# AddRoundKey application of round specific sub-key
+#
+# -------------------------------------------------------------------------
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+# -------------------------------------------------------------------------
+
+package require Tcl 8.2
+
+namespace eval ::aes {
+ variable version 1.1.1
+ variable rcsid {$Id: aes.tcl,v 1.7 2010/07/06 19:39:00 andreas_kupries Exp $}
+ variable uid ; if {![info exists uid]} { set uid 0 }
+
+ namespace export {aes}
+
+ # constants
+
+ # S-box
+ variable sbox {
+ 0x63 0x7c 0x77 0x7b 0xf2 0x6b 0x6f 0xc5 0x30 0x01 0x67 0x2b 0xfe 0xd7 0xab 0x76
+ 0xca 0x82 0xc9 0x7d 0xfa 0x59 0x47 0xf0 0xad 0xd4 0xa2 0xaf 0x9c 0xa4 0x72 0xc0
+ 0xb7 0xfd 0x93 0x26 0x36 0x3f 0xf7 0xcc 0x34 0xa5 0xe5 0xf1 0x71 0xd8 0x31 0x15
+ 0x04 0xc7 0x23 0xc3 0x18 0x96 0x05 0x9a 0x07 0x12 0x80 0xe2 0xeb 0x27 0xb2 0x75
+ 0x09 0x83 0x2c 0x1a 0x1b 0x6e 0x5a 0xa0 0x52 0x3b 0xd6 0xb3 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0x26 0xe1 0x69 0x14 0x63 0x55 0x21 0x0c 0x7d
+ }
+}
+
+# aes::Init --
+#
+# Initialise our AES state and calculate the key schedule. An initialization
+# vector is maintained in the state for modes that require one. The key must
+# be binary data of the correct size and the IV must be 16 bytes.
+#
+# Nk: columns of the key-array
+# Nr: number of rounds (depends on key-length)
+# Nb: columns of the text-block, is always 4 in AES
+#
+proc ::aes::Init {mode key iv} {
+ switch -exact -- $mode {
+ ecb - cbc { }
+ cfb - ofb {
+ return -code error "$mode mode not implemented"
+ }
+ default {
+ return -code error "invalid mode \"$mode\":\
+ must be one of ecb or cbc."
+ }
+ }
+
+ set size [expr {[string length $key] << 3}]
+ switch -exact -- $size {
+ 128 {set Nk 4; set Nr 10; set Nb 4}
+ 192 {set Nk 6; set Nr 12; set Nb 4}
+ 256 {set Nk 8; set Nr 14; set Nb 4}
+ default {
+ return -code error "invalid key size \"$size\":\
+ must be one of 128, 192 or 256."
+ }
+ }
+
+ variable uid
+ set Key [namespace current]::[incr uid]
+ upvar #0 $Key state
+ array set state [list M $mode K $key I $iv Nk $Nk Nr $Nr Nb $Nb W {}]
+ ExpandKey $Key
+ return $Key
+}
+
+# aes::Reset --
+#
+# Reset the initialization vector for the specified key. This permits the
+# key to be reused for encryption or decryption without the expense of
+# re-calculating the key schedule.
+#
+proc ::aes::Reset {Key iv} {
+ upvar #0 $Key state
+ set state(I) $iv
+ return
+}
+
+# aes::Final --
+#
+# Clean up the key state
+#
+proc ::aes::Final {Key} {
+ # FRINK: nocheck
+ unset $Key
+}
+
+# -------------------------------------------------------------------------
+
+# 5.1 Cipher: Encipher a single block of 128 bits.
+proc ::aes::EncryptBlock {Key block} {
+ upvar #0 $Key state
+ if {[binary scan $block I4 data] != 1} {
+ return -code error "invalid block size: blocks must be 16 bytes"
+ }
+
+ if {[string equal $state(M) cbc]} {
+ if {[binary scan $state(I) I4 iv] != 1} {
+ return -code error "invalid initialization vector: must be 16 bytes"
+ }
+ for {set n 0} {$n < 4} {incr n} {
+ lappend data2 [expr {0xffffffff & ([lindex $data $n] ^ [lindex $iv $n])}]
+ }
+ set data $data2
+ }
+
+ set data [AddRoundKey $Key 0 $data]
+ for {set n 1} {$n < $state(Nr)} {incr n} {
+ set data [AddRoundKey $Key $n [MixColumns [ShiftRows [SubBytes $data]]]]
+ }
+ set data [AddRoundKey $Key $n [ShiftRows [SubBytes $data]]]
+
+ # Bug 2993029:
+ # Force all elements of data into the 32bit range.
+ set res {}
+ foreach d $data {
+ lappend res [expr {$d & 0xffffffff}]
+ }
+ set data $res
+
+ return [set state(I) [binary format I4 $data]]
+}
+
+# 5.3: Inverse Cipher: Decipher a single 128 bit block.
+proc ::aes::DecryptBlock {Key block} {
+ upvar #0 $Key state
+ if {[binary scan $block I4 data] != 1} {
+ return -code error "invalid block size: block must be 16 bytes"
+ }
+
+ set n $state(Nr)
+ set data [AddRoundKey $Key $state(Nr) $data]
+ for {incr n -1} {$n > 0} {incr n -1} {
+ set data [InvMixColumns [AddRoundKey $Key $n [InvSubBytes [InvShiftRows $data]]]]
+ }
+ set data [AddRoundKey $Key $n [InvSubBytes [InvShiftRows $data]]]
+
+ if {[string equal $state(M) cbc]} {
+ if {[binary scan $state(I) I4 iv] != 1} {
+ return -code error "invalid initialization vector: must be 16 bytes"
+ }
+ for {set n 0} {$n < 4} {incr n} {
+ lappend data2 [expr {0xffffffff & ([lindex $data $n] ^ [lindex $iv $n])}]
+ }
+ set data $data2
+ } else {
+ # Bug 2993029:
+ # Force all elements of data into the 32bit range.
+ # The trimming we see above only happens for CBC mode.
+ set res {}
+ foreach d $data {
+ lappend res [expr {$d & 0xffffffff}]
+ }
+ set data $res
+ }
+
+ set state(I) $block
+ return [binary format I4 $data]
+}
+
+# 5.2: KeyExpansion
+proc ::aes::ExpandKey {Key} {
+ upvar #0 $Key state
+ set Rcon [list 0x00000000 0x01000000 0x02000000 0x04000000 0x08000000 \
+ 0x10000000 0x20000000 0x40000000 0x80000000 0x1b000000 \
+ 0x36000000 0x6c000000 0xd8000000 0xab000000 0x4d000000]
+ # Split the key into Nk big-endian words
+ binary scan $state(K) I* W
+ set max [expr {$state(Nb) * ($state(Nr) + 1)}]
+ set i $state(Nk)
+ set h $state(Nk) ; incr h -1
+ set j 0
+ for {} {$i < $max} {incr i; incr h; incr j} {
+ set temp [lindex $W $h]
+ if {($i % $state(Nk)) == 0} {
+ set sub [SubWord [RotWord $temp]]
+ set rc [lindex $Rcon [expr {$i/$state(Nk)}]]
+ set temp [expr {$sub ^ $rc}]
+ } elseif {$state(Nk) > 6 && ($i % $state(Nk)) == 4} {
+ set temp [SubWord $temp]
+ }
+ lappend W [expr {[lindex $W $j] ^ $temp}]
+ }
+ set state(W) $W
+ return
+}
+
+# 5.2: Key Expansion: Apply S-box to each byte in the 32 bit word
+proc ::aes::SubWord {w} {
+ variable sbox
+ set s3 [lindex $sbox [expr {(($w >> 24) & 255)}]]
+ set s2 [lindex $sbox [expr {(($w >> 16) & 255)}]]
+ set s1 [lindex $sbox [expr {(($w >> 8 ) & 255)}]]
+ set s0 [lindex $sbox [expr {( $w & 255)}]]
+ return [expr {($s3 << 24) | ($s2 << 16) | ($s1 << 8) | $s0}]
+}
+
+proc ::aes::InvSubWord {w} {
+ variable xobs
+ set s3 [lindex $xobs [expr {(($w >> 24) & 255)}]]
+ set s2 [lindex $xobs [expr {(($w >> 16) & 255)}]]
+ set s1 [lindex $xobs [expr {(($w >> 8 ) & 255)}]]
+ set s0 [lindex $xobs [expr {( $w & 255)}]]
+ return [expr {($s3 << 24) | ($s2 << 16) | ($s1 << 8) | $s0}]
+}
+
+# 5.2: Key Expansion: Rotate a 32bit word by 8 bits
+proc ::aes::RotWord {w} {
+ return [expr {(($w << 8) | (($w >> 24) & 0xff)) & 0xffffffff}]
+}
+
+# 5.1.1: SubBytes() Transformation
+proc ::aes::SubBytes {words} {
+ set r {}
+ foreach w $words {
+ lappend r [SubWord $w]
+ }
+ return $r
+}
+
+# 5.3.2: InvSubBytes() Transformation
+proc ::aes::InvSubBytes {words} {
+ set r {}
+ foreach w $words {
+ lappend r [InvSubWord $w]
+ }
+ return $r
+}
+
+# 5.1.2: ShiftRows() Transformation
+proc ::aes::ShiftRows {words} {
+ for {set n0 0} {$n0 < 4} {incr n0} {
+ set n1 [expr {($n0 + 1) % 4}]
+ set n2 [expr {($n0 + 2) % 4}]
+ set n3 [expr {($n0 + 3) % 4}]
+ lappend r [expr {( [lindex $words $n0] & 0xff000000)
+ | ([lindex $words $n1] & 0x00ff0000)
+ | ([lindex $words $n2] & 0x0000ff00)
+ | ([lindex $words $n3] & 0x000000ff)
+ }]
+ }
+ return $r
+}
+
+
+# 5.3.1: InvShiftRows() Transformation
+proc ::aes::InvShiftRows {words} {
+ for {set n0 0} {$n0 < 4} {incr n0} {
+ set n1 [expr {($n0 + 1) % 4}]
+ set n2 [expr {($n0 + 2) % 4}]
+ set n3 [expr {($n0 + 3) % 4}]
+ lappend r [expr {( [lindex $words $n0] & 0xff000000)
+ | ([lindex $words $n3] & 0x00ff0000)
+ | ([lindex $words $n2] & 0x0000ff00)
+ | ([lindex $words $n1] & 0x000000ff)
+ }]
+ }
+ return $r
+}
+
+# 5.1.3: MixColumns() Transformation
+proc ::aes::MixColumns {words} {
+ set r {}
+ foreach w $words {
+ set r0 [expr {(($w >> 24) & 255)}]
+ set r1 [expr {(($w >> 16) & 255)}]
+ set r2 [expr {(($w >> 8 ) & 255)}]
+ set r3 [expr {( $w & 255)}]
+
+ set s0 [expr {[GFMult2 $r0] ^ [GFMult3 $r1] ^ $r2 ^ $r3}]
+ set s1 [expr {$r0 ^ [GFMult2 $r1] ^ [GFMult3 $r2] ^ $r3}]
+ set s2 [expr {$r0 ^ $r1 ^ [GFMult2 $r2] ^ [GFMult3 $r3]}]
+ set s3 [expr {[GFMult3 $r0] ^ $r1 ^ $r2 ^ [GFMult2 $r3]}]
+
+ lappend r [expr {($s0 << 24) | ($s1 << 16) | ($s2 << 8) | $s3}]
+ }
+ return $r
+}
+
+# 5.3.3: InvMixColumns() Transformation
+proc ::aes::InvMixColumns {words} {
+ set r {}
+ foreach w $words {
+ set r0 [expr {(($w >> 24) & 255)}]
+ set r1 [expr {(($w >> 16) & 255)}]
+ set r2 [expr {(($w >> 8 ) & 255)}]
+ set r3 [expr {( $w & 255)}]
+
+ set s0 [expr {[GFMult0e $r0] ^ [GFMult0b $r1] ^ [GFMult0d $r2] ^ [GFMult09 $r3]}]
+ set s1 [expr {[GFMult09 $r0] ^ [GFMult0e $r1] ^ [GFMult0b $r2] ^ [GFMult0d $r3]}]
+ set s2 [expr {[GFMult0d $r0] ^ [GFMult09 $r1] ^ [GFMult0e $r2] ^ [GFMult0b $r3]}]
+ set s3 [expr {[GFMult0b $r0] ^ [GFMult0d $r1] ^ [GFMult09 $r2] ^ [GFMult0e $r3]}]
+
+ lappend r [expr {($s0 << 24) | ($s1 << 16) | ($s2 << 8) | $s3}]
+ }
+ return $r
+}
+
+# 5.1.4: AddRoundKey() Transformation
+proc ::aes::AddRoundKey {Key round words} {
+ upvar #0 $Key state
+ set r {}
+ set n [expr {$round * $state(Nb)}]
+ foreach w $words {
+ lappend r [expr {$w ^ [lindex $state(W) $n]}]
+ incr n
+ }
+ return $r
+}
+
+# -------------------------------------------------------------------------
+# ::aes::GFMult*
+#
+# some needed functions for multiplication in a Galois-field
+#
+proc ::aes::GFMult2 {number} {
+ # this is a tabular representation of xtime (multiplication by 2)
+ # it is used instead of calculation to prevent timing attacks
+ set xtime {
+ 0x00 0x02 0x04 0x06 0x08 0x0a 0x0c 0x0e 0x10 0x12 0x14 0x16 0x18 0x1a 0x1c 0x1e
+ 0x20 0x22 0x24 0x26 0x28 0x2a 0x2c 0x2e 0x30 0x32 0x34 0x36 0x38 0x3a 0x3c 0x3e
+ 0x40 0x42 0x44 0x46 0x48 0x4a 0x4c 0x4e 0x50 0x52 0x54 0x56 0x58 0x5a 0x5c 0x5e
+ 0x60 0x62 0x64 0x66 0x68 0x6a 0x6c 0x6e 0x70 0x72 0x74 0x76 0x78 0x7a 0x7c 0x7e
+ 0x80 0x82 0x84 0x86 0x88 0x8a 0x8c 0x8e 0x90 0x92 0x94 0x96 0x98 0x9a 0x9c 0x9e
+ 0xa0 0xa2 0xa4 0xa6 0xa8 0xaa 0xac 0xae 0xb0 0xb2 0xb4 0xb6 0xb8 0xba 0xbc 0xbe
+ 0xc0 0xc2 0xc4 0xc6 0xc8 0xca 0xcc 0xce 0xd0 0xd2 0xd4 0xd6 0xd8 0xda 0xdc 0xde
+ 0xe0 0xe2 0xe4 0xe6 0xe8 0xea 0xec 0xee 0xf0 0xf2 0xf4 0xf6 0xf8 0xfa 0xfc 0xfe
+ 0x1b 0x19 0x1f 0x1d 0x13 0x11 0x17 0x15 0x0b 0x09 0x0f 0x0d 0x03 0x01 0x07 0x05
+ 0x3b 0x39 0x3f 0x3d 0x33 0x31 0x37 0x35 0x2b 0x29 0x2f 0x2d 0x23 0x21 0x27 0x25
+ 0x5b 0x59 0x5f 0x5d 0x53 0x51 0x57 0x55 0x4b 0x49 0x4f 0x4d 0x43 0x41 0x47 0x45
+ 0x7b 0x79 0x7f 0x7d 0x73 0x71 0x77 0x75 0x6b 0x69 0x6f 0x6d 0x63 0x61 0x67 0x65
+ 0x9b 0x99 0x9f 0x9d 0x93 0x91 0x97 0x95 0x8b 0x89 0x8f 0x8d 0x83 0x81 0x87 0x85
+ 0xbb 0xb9 0xbf 0xbd 0xb3 0xb1 0xb7 0xb5 0xab 0xa9 0xaf 0xad 0xa3 0xa1 0xa7 0xa5
+ 0xdb 0xd9 0xdf 0xdd 0xd3 0xd1 0xd7 0xd5 0xcb 0xc9 0xcf 0xcd 0xc3 0xc1 0xc7 0xc5
+ 0xfb 0xf9 0xff 0xfd 0xf3 0xf1 0xf7 0xf5 0xeb 0xe9 0xef 0xed 0xe3 0xe1 0xe7 0xe5
+ }
+ return [lindex $xtime $number]
+}
+
+proc ::aes::GFMult3 {number} {
+ # multliply by 2 (via GFMult2) and add the number again on the result (via XOR)
+ return [expr {$number ^ [GFMult2 $number]}]
+}
+
+proc ::aes::GFMult09 {number} {
+ # 09 is: (02*02*02) + 01
+ return [expr {[GFMult2 [GFMult2 [GFMult2 $number]]] ^ $number}]
+}
+
+proc ::aes::GFMult0b {number} {
+ # 0b is: (02*02*02) + 02 + 01
+ #return [expr [GFMult2 [GFMult2 [GFMult2 $number]]] ^ [GFMult2 $number] ^ $number]
+ #set g0 [GFMult2 $number]
+ return [expr {[GFMult09 $number] ^ [GFMult2 $number]}]
+}
+
+proc ::aes::GFMult0d {number} {
+ # 0d is: (02*02*02) + (02*02) + 01
+ set temp [GFMult2 [GFMult2 $number]]
+ return [expr {[GFMult2 $temp] ^ ($temp ^ $number)}]
+}
+
+proc ::aes::GFMult0e {number} {
+ # 0e is: (02*02*02) + (02*02) + 02
+ set temp [GFMult2 [GFMult2 $number]]
+ return [expr {[GFMult2 $temp] ^ ($temp ^ [GFMult2 $number])}]
+}
+
+# -------------------------------------------------------------------------
+
+# aes::Encrypt --
+#
+# Encrypt a blocks of plain text and returns blocks of cipher text.
+# The input data must be a multiple of the block size (16).
+#
+proc ::aes::Encrypt {Key data} {
+ set len [string length $data]
+ if {($len % 16) != 0} {
+ return -code error "invalid block size: AES requires 16 byte blocks"
+ }
+
+ set result {}
+ for {set i 0} {$i < $len} {incr i 1} {
+ set block [string range $data $i [incr i 15]]
+ append result [EncryptBlock $Key $block]
+ }
+ return $result
+}
+
+# aes::DecryptBlock --
+#
+# Decrypt a blocks of cipher text and returns blocks of plain text.
+# The input data must be a multiple of the block size (16).
+#
+proc ::aes::Decrypt {Key data} {
+ set len [string length $data]
+ if {($len % 16) != 0} {
+ return -code error "invalid block size: AES requires 16 byte blocks"
+ }
+
+ set result {}
+ for {set i 0} {$i < $len} {incr i 1} {
+ set block [string range $data $i [incr i 15]]
+ append result [DecryptBlock $Key $block]
+ }
+ return $result
+}
+
+# -------------------------------------------------------------------------
+# Fileevent handler for chunked file reading.
+#
+proc ::aes::Chunk {Key in {out {}} {chunksize 4096}} {
+ upvar #0 $Key state
+
+ #puts ||CHUNK.X||i=$in|o=$out|c=$chunksize|eof=[eof $in]
+
+ if {[eof $in]} {
+ fileevent $in readable {}
+ set state(reading) 0
+ }
+
+ set data [read $in $chunksize]
+
+ #puts ||CHUNK.R||i=$in|o=$out|c=$chunksize|eof=[eof $in]||[string length $data]||$data||
+
+ # Do nothing when data was read at all.
+ if {![string length $data]} return
+
+ if {[eof $in]} {
+ #puts CHUNK.Z
+ set data [Pad $data 16]
+ }
+
+ #puts ||CHUNK.P||i=$in|o=$out|c=$chunksize|eof=[eof $in]||[string length $data]||$data||
+
+ if {$out == {}} {
+ append state(output) [$state(cmd) $Key $data]
+ } else {
+ puts -nonewline $out [$state(cmd) $Key $data]
+ }
+}
+
+proc ::aes::SetOneOf {lst item} {
+ set ndx [lsearch -glob $lst "${item}*"]
+ if {$ndx == -1} {
+ set err [join $lst ", "]
+ return -code error "invalid mode \"$item\": must be one of $err"
+ }
+ return [lindex $lst $ndx]
+}
+
+proc ::aes::CheckSize {what size thing} {
+ if {[string length $thing] != $size} {
+ return -code error "invalid value for $what: must be $size bytes long"
+ }
+ return $thing
+}
+
+proc ::aes::Pad {data blocksize {fill \0}} {
+ set len [string length $data]
+ if {$len == 0} {
+ set data [string repeat $fill $blocksize]
+ } elseif {($len % $blocksize) != 0} {
+ set pad [expr {$blocksize - ($len % $blocksize)}]
+ append data [string repeat $fill $pad]
+ }
+ return $data
+}
+
+proc ::aes::Pop {varname {nth 0}} {
+ upvar 1 $varname args
+ set r [lindex $args $nth]
+ set args [lreplace $args $nth $nth]
+ return $r
+}
+
+proc ::aes::Hex {data} {
+ binary scan $data H* r
+ return $r
+}
+
+proc ::aes::aes {args} {
+ array set opts {-dir encrypt -mode cbc -key {} -in {} -out {} -chunksize 4096 -hex 0}
+ set opts(-iv) [string repeat \0 16]
+ set modes {ecb cbc}
+ set dirs {encrypt decrypt}
+ while {([llength $args] > 1) && [string match -* [set option [lindex $args 0]]]} {
+ switch -exact -- $option {
+ -mode { set opts(-mode) [SetOneOf $modes [Pop args 1]] }
+ -dir { set opts(-dir) [SetOneOf $dirs [Pop args 1]] }
+ -iv { set opts(-iv) [CheckSize -iv 16 [Pop args 1]] }
+ -key { set opts(-key) [Pop args 1] }
+ -in { set opts(-in) [Pop args 1] }
+ -out { set opts(-out) [Pop args 1] }
+ -chunksize { set opts(-chunksize) [Pop args 1] }
+ -hex { set opts(-hex) 1 }
+ -- { Pop args ; break }
+ default {
+ set err [join [lsort [array names opts]] ", "]
+ return -code error "bad option \"$option\":\
+ must be one of $err"
+ }
+ }
+ Pop args
+ }
+
+ if {$opts(-key) == {}} {
+ return -code error "no key provided: the -key option is required"
+ }
+
+ set r {}
+ if {$opts(-in) == {}} {
+
+ if {[llength $args] != 1} {
+ return -code error "wrong \# args:\
+ should be \"aes ?options...? -key keydata plaintext\""
+ }
+
+ set data [Pad [lindex $args 0] 16]
+ set Key [Init $opts(-mode) $opts(-key) $opts(-iv)]
+ if {[string equal $opts(-dir) "encrypt"]} {
+ set r [Encrypt $Key $data]
+ } else {
+ set r [Decrypt $Key $data]
+ }
+
+ if {$opts(-out) != {}} {
+ puts -nonewline $opts(-out) $r
+ set r {}
+ }
+ Final $Key
+
+ } else {
+
+ if {[llength $args] != 0} {
+ return -code error "wrong \# args:\
+ should be \"aes ?options...? -key keydata -in channel\""
+ }
+
+ set Key [Init $opts(-mode) $opts(-key) $opts(-iv)]
+
+ set readcmd [list [namespace origin Chunk] \
+ $Key $opts(-in) $opts(-out) \
+ $opts(-chunksize)]
+
+ upvar 1 $Key state
+ set state(reading) 1
+ if {[string equal $opts(-dir) "encrypt"]} {
+ set state(cmd) Encrypt
+ } else {
+ set state(cmd) Decrypt
+ }
+ set state(output) ""
+ fileevent $opts(-in) readable $readcmd
+ if {[info commands ::tkwait] != {}} {
+ tkwait variable [subst $Key](reading)
+ } else {
+ vwait [subst $Key](reading)
+ }
+ if {$opts(-out) == {}} {
+ set r $state(output)
+ }
+ Final $Key
+ }
+
+ if {$opts(-hex)} {
+ set r [Hex $r]
+ }
+ return $r
+}
+
+# -------------------------------------------------------------------------
+
+package provide aes $::aes::version
+
+# -------------------------------------------------------------------------
+# Local variables:
+# mode: tcl
+# indent-tabs-mode: nil
+# End:
ADDED packages/tcl/8.4/neutral/tcllib1.15/aes/aes.tcl.asc
Index: packages/tcl/8.4/neutral/tcllib1.15/aes/aes.tcl.asc
==================================================================
--- packages/tcl/8.4/neutral/tcllib1.15/aes/aes.tcl.asc
+++ packages/tcl/8.4/neutral/tcllib1.15/aes/aes.tcl.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJXtl6FAAoJEFAslq9JXcLZenMQAKEdxioTYCPWs5wEYERfn/8x
+GklZUR/LGTNV0w0JO13BxwUsrwOC0BMI3iRhFGBNyd6J7RqkvulbfEADdzZoTofF
+INfhpT+sJoXScmg1pzcJmZdUGP7vBmG6+askcVSkafZmesp6DR03lPI3x323A6dm
+kJPIy87UMCB+g2L+V/+BhWJgrQloekWNUKsElcWBc3N+K3lWbx48jgkcLow5K2St
+qg0paqW5T6doT6Ig27JKy71SRreMi2OsJs/HA+KxND9diC2hfVC87dkVGyoKHOJG
+fsX6j+Fz3Eygg7sw+U3EIIMOj/eQiWZJ/eCn1UbxvCcGORHiQnDztTpfEIETM+dz
+TNAvjWlC2ISDDJAyc1C02ok+ee+6chfJhe8aH9Fj/AK4tmJ9xXyF6FMz0yZ/F/3k
+LCggJlO0eVnngjwDwGuz6czJ7VccRDgwdXtpkMJtq4yJtZOHaoYXUr6fgGoW4i3r
+yOQu2Ajk/ZU9l8tTXbXWhexn+x+TbbhLUuOckEu8Mk7ID+Z2EMA4AyzvfwytbCbk
+8Wi4J0gDa/cV2JvncQAlcZ6u+4mgWhMyUg8gq2bMsYwJd6/8XzEIaF4752UFiUiV
+AeOdPeGeqfELAlUagLAQOuHiFAK22VU0jPTp0f8MNvSITdheI7EeUNY7gM0a7odI
+hf4M9GphdltjwhC1p4FI
+=kVUR
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl
Index: packages/tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl
==================================================================
--- packages/tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl
+++ packages/tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl
@@ -0,0 +1,5 @@
+if {![package vsatisfies [package provide Tcl] 8.2]} {
+ # PRAGMA: returnok
+ return
+}
+package ifneeded aes 1.1.1 [list source [file join $dir aes.tcl]]
ADDED packages/tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl.asc
Index: packages/tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl.asc
==================================================================
--- packages/tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl.asc
+++ packages/tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJXtl6JAAoJEFAslq9JXcLZSf4QAKFsBhYHqlALRprs1hhXArfc
+jamjLJCUFZRrsU1exvmbiU/2SCsFwveL8gDHtRGvHrKZpepVSSh1vAK1DFAEW5zR
+2/bnMRnmYKfbdmLe7bd8xZqRDQjgMRIq/rs5Op9bgb+AstasiQLbjvNNJt2Q56d0
+wYWSH4w5qkniJSfakXSf+4HyFcU8kSG+rvkqOqGrKqQTY0DhJVTsjAZHA6+gE3T+
+xx6mUXiJjrnU429pht4mry5d8bSEIbARYi6B9AIbaboqlgcDTaMTmNpHRDpVx+VO
+F1Q/JtRsI0tMvbMhHFITzOVP+HyEax1tTm+bMArdnYvECvawwQ+rG7IudNFInZPE
+EXNg+qunEUpcR+bgdhnQDqZDpslmA4ZThIxDRyAYwx6e1NddVF3uhdL2/Fatdmrs
+WS1HwzZFN5nQtnKo0l9yTnp3TAo2Zjx9HhEQNo5zMAzFy5bnLrIbz2xSRL9xBIJ9
+N4EtBvPWW+IKfyLxz/mP5dkYrhUDvAxbThsR/li2HI3dhwfU7aSXVkuBMDBvrklz
+8W3SHNcTHDeoB5dE9z4JTSKgZoxKBQwD5dstsSbYeykxuHVBcjL1EkLjr1iCduIu
+NBCPuaLpxEEVREyN3QeHObH4+QrXPKsgE8sm5V6a2rVyfS6koBAOX+eDIlfXdo8N
+B0KCHquWJYaanWwDdOTK
+=53sI
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/win32-x86/Garuda1.0/Garuda.dll
Index: packages/tcl/8.4/win32-x86/Garuda1.0/Garuda.dll
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/Garuda.dll
+++ packages/tcl/8.4/win32-x86/Garuda1.0/Garuda.dll
cannot compute difference between binary files
ADDED packages/tcl/8.4/win32-x86/Garuda1.0/Garuda.dll.asc
Index: packages/tcl/8.4/win32-x86/Garuda1.0/Garuda.dll.asc
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/Garuda.dll.asc
+++ packages/tcl/8.4/win32-x86/Garuda1.0/Garuda.dll.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJYHke4AAoJEFAslq9JXcLZOsoP/RuN+mN8tuf7oSMJIsuRP8zt
+/fvI/9avl8IqUhe8Z5NOx5SEMCBkpJn9WFB+goGYCs8F1BK2FHzYsk/RkaiL3swk
+4hfJO+miUOqak1p8q/mTsJHkAaIxebMxRm78/ZN8Zh9m5q/4xBuVV52jVmyDaDd2
+1Jihu8E0pBSl4G65HnAyiBEPV0EQiQAJz2fuHoDfsg0tHoLYR+UJbPhpqVO9Q5to
+T9ZHNjJLb8ReI5TUHk/sfBYMHx595R0wzXF2DTMO8H52O8pqTFHJzYyi0jtLLEfn
+UFxEiVueDVKCjNEvi83xWm/jO2pU1W/6TnPnjpj3fyLw7Ve/I1whZx1uM8kKSxjp
+uRkHT/w9zof3c68r1neg0oOwBKMLIL4gbHOeaPwvvEqC9diNuM9LR6JhyqFMU60C
+VSvYKjfD7cBc/81MMZSJ2jAh8/RKL8lp7P1zK2S5V2dp1jAWIymIYdDBfePhsmwK
+X4C5DreYpK60Stpxjo+xwu5m84vNQCsCSBKZ1mpsZLh04uWjQxBlu/0eYwPxewT5
+xpqD4nWrv4R3jyzzUIi2+qZuIPt4z+6CfeDvMgjO9Da0waV/bXgw/FMFinYLtRBI
+YaI4iVdaW1H+MsDoeb8ww+pWFE62IrXNRjtLjMTH5wKtpf+ugccZrfnnEpJFcy24
+I7JB1IhJpO5fa3suHLfv
+=k0mL
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl
Index: packages/tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl
+++ packages/tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl
@@ -0,0 +1,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 {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/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl.asc
Index: packages/tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl.asc
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl.asc
+++ packages/tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl.asc
@@ -0,0 +1,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/win32-x86/Garuda1.0/Tests/all.tcl
Index: packages/tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl
+++ packages/tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl
@@ -0,0 +1,809 @@
+###############################################################################
+#
+# 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: $
+#
+###############################################################################
+
+if {![package vsatisfies [package provide Tcl] 8.4]} then {
+ error "need Tcl 8.4 or higher"
+}
+
+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:
+
+ #
+ # 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.
+ # "\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/win32-x86/Garuda1.0/Tests/all.tcl.asc
Index: packages/tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl.asc
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl.asc
+++ packages/tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJYHkfCAAoJEFAslq9JXcLZmJMP/3QXndKpA/lBhAWC77PCemDo
+2JMrmXTe5WjuIkK5CFb4b6Vb8ULpqX1aRzgs4WuBCxIgyyU6v0XOHoRbaXPpobXn
+ZUquU/+y+fYlhSxWaCmq0es6RM5Zuu8t6hHvBPFc1dHN+1LjFAivKEVl/aZgGnsU
+QDeUCdvTtL1AQPdiHmlQSp35j/sN01/7Rl6ANUw4VtDEqm+qfYAo5BDhGO+M2RV1
+awcYI1cHkEK565d2GcBJQt7z2dAJiJ2u5zJ4LyBaaaBpppFaQwj2neGA/z00km0c
+4bcKtyAQNFKV0gDoE9FH0GUN13WZGsj0sKs63cXXcbpYbJM1PlAYvZAPG5xAGQxN
+2VRfEDbtNkilHawFfUQMP5lNLBm0gpc/l3BLtkZgMMx9HN71mdFKEj9MT9ia3e0t
+PgVPHvt6vXBBojmn7aBKF/+1g3nREP1Nr16rAynooer1S+bFjmjfyAT3eNIMyg7B
+z285/pixIyVJf8NqX3bEGMGzO3kd2JmU+aU14hI9nF5Mf8vF1UBevvLPhTLHvrCM
+S1uaWQ+OXEBS0yfgvf1jn2j/I1wftRf9PxkIrSw2DbCjyRwRHFwGRrekh2K8EAlu
+ua7MWnqXIm0iuynKSpQqHnk8OiCaqTBYASAGPTvr/sm22SpXSznwmcCSwYhB4Ff+
+CbvkZLKRcFTNfgLA1E3h
+=s7yt
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl
Index: packages/tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl
+++ packages/tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl
@@ -0,0 +1,98 @@
+###############################################################################
+#
+# 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: $
+#
+###############################################################################
+
+if {![package vsatisfies [package provide Tcl] 8.4]} then {
+ error "need Tcl 8.4 or higher"
+}
+
+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/win32-x86/Garuda1.0/dotnet.tcl.asc
Index: packages/tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl.asc
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl.asc
+++ packages/tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJYHkfUAAoJEFAslq9JXcLZ804QAL06jaQ3FBEYEupItJeRolHz
+0s4QHRueoru4DUMLoSwCEsJE3SphtKaQBI9Sp0THguDeLEx0hKYQ82tjDbntMgIy
+cDs3KOpRwMs0TKNcbQWbu8VAPrUyYnoAbAwgEBsbY4JjOlZf/ooZC2WMFe0PoC/d
+A+hIAXVx/xAKxQ9Tpg73AdUJB4WX9uvy+85RDzQnh8axWNfUWJ7TzevoaEuVnlDW
+fZ3ijY5xp1iFmmY9NJYvH5TcYpsRxzags5J8lSHT6jK+v4LghH8LCKnax5JGYAU3
+JqZFGK/ktZZDAKzGxJMRE1FNkP1ZKkB1lMBSE85mQAmX2sUIohMDzA1t0CgTv94E
+Ae0A7aA6NKwVQqIZulJUimY6ldmRpOuJEgg0wIMID7RmpZJHw8/JTCANh46unCyO
+L1esx40BmKf4KEHgG/BF5L81e3E2n7GbT/e7m3BgwrjpHcg36lILl7/XKkKE9p1N
+bFSShsr3ms2j6BVRpmqydRCGOPof2DW3Su3K5mATePaF/AUII5hWE5hzYe5vKgpA
+EB/vriJtckgVmayWI2aKK45H9R70WTNzWs8FJyl2dZ9OpZp/0nYGRzXPvwktQPgJ
+XMAV+C4nDkpYRWhvnRc43SzsdMEDTOukK0/K47scMvHfO8TDyvy1h7aGcO73gfuu
+nP0gAzTO2UyCNAsxiBHS
+=WoFZ
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/win32-x86/Garuda1.0/helper.tcl
Index: packages/tcl/8.4/win32-x86/Garuda1.0/helper.tcl
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/helper.tcl
+++ packages/tcl/8.4/win32-x86/Garuda1.0/helper.tcl
@@ -0,0 +1,1491 @@
+###############################################################################
+#
+# 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: $
+#
+###############################################################################
+
+if {![package vsatisfies [package provide Tcl] 8.4]} then {
+ error "need Tcl 8.4 or higher"
+}
+
+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:
+
+ #
+ # 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/win32-x86/Garuda1.0/helper.tcl.asc
Index: packages/tcl/8.4/win32-x86/Garuda1.0/helper.tcl.asc
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/helper.tcl.asc
+++ packages/tcl/8.4/win32-x86/Garuda1.0/helper.tcl.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJYHkfJAAoJEFAslq9JXcLZyTUQAMV0hWZy/I+Va3JUtRFRXA8I
+k4mdkoUf4rP3XH6pj0dLaa7dFMxtc+D2v6gMZN6HU+Lm4l05E7f+7Uvew1Y1kGOO
+Aya5Rt8YIcPY29VlNA/q+e++JTWBPR5kAHZ7AwxjAfOL1zI8fEX3GIcfofFLrC2Z
+llpFcQy5nu7PhZgFygUwa+BYNA69fFl7snbMcsI9DLfR/eGqGu2nCq4TPdYgJ8Vc
+RKbOUa4Rj8VtNi3Gb5+eLSBddHdl6l+qB3gMyQjl5khhONlMYoAhY2VgSFCu7zbH
+pHrwPuzALwwpSNzQRUEwDz9xZI+vHt3eAONfMj1uqKkyU7RZdp9U6/q+jj5Db9vA
+t8TnR2JuGYcHqJ0RaMSC2EzecFx5I2wXmWecwDHagL5TCaKI+KRgjUNgGCWuPrNk
+UrBMSfJWncJGVt1DhytoczupumsY/91v+8HI7B9usv8yBE+xp1c6WIYbNTq4qeLK
+dB55TZ5jYXnIQYDEdTLWk7G01EVybKOQSY1tCQK9xCA1PTAv6f7gTGkX68+QtkT0
+6/P4sszZRlWi/+OI7uNJ6bfZnlrFjgrFLjihL1DzAEzg2vaFLteJI7TzeRExsSjs
+0Hd1mnlKBhaptefvj8TXZB5JSM+tc3gv6mrAIOmKJxtzy3btlYInI4aTVFIVtHw7
+XBk7c+Bg9lILOKTThOrN
+=P/A1
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll
Index: packages/tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll
+++ packages/tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll
cannot compute difference between binary files
ADDED packages/tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll.asc
Index: packages/tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll.asc
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll.asc
+++ packages/tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+Comment: Eagle Package Repository
+
+iQIcBAABCAAGBQJYAbNqAAoJEFAslq9JXcLZ0oIQAIq1bal4dfgFgwHEC3W/Zw+Y
+C1+OkubOZYhQhOyup6ypJmxwdKtjuFkrKwV+1ykQTaZHUO9v7n6kdQ6bZ+rY7o5M
+nF37AjyhATkA95NKkDYP/HZAOVNkNCVWR+eRKOH0PeQb8Qb4pJEvviKMwRA5O5wz
+JSs8E9zQSIqPbdZlmPZrZri8kIZx4AwymSpR+a8rEwfdPtnDMpcUAmMnyDRy2JI4
+y8pDlgCrQnDNn6Iq7Dn5V0IMGZm1fljVKIF80BIaW2CWf+f/TYdkFJEY08Ttev7l
+16GQr7cYS7xM9PKgSfHPsMfrlJ8HuWhBh801MJDM1ounihKgas8y6GQrpokFNFsb
+Gzq9mQ1b3td4CEJw5MClzN2EgWe1hF3dx+kdR9aEOPMEakpaoyyTAmzSV+f5FJem
++4I6JlMUO5SlxCdC+FjMEV1ISlSmX91AwDMOSSEhZId7D5y4IXxHZVuyML9JjMNg
+KKYZdII1MsdDowemzLWT+gVIDhvPQVe0b4E2PKlIwM+rk9RceKufq4fNx/ThnA4k
+d2LmEryioi01yivzUMpYJx9wQE5TzHNGgiJMFywsCuiPimztwuCZtaw3zGadPXy9
+vZ+yKiNg37JqOJbNxNG7Zuag10/xqxNZLkCZ3TpGgg2tn+igM2jQ48SXxiFPMNKg
+MTUxCCWawS3oUa8iBH4d
+=VfUA
+-----END PGP SIGNATURE-----
ADDED packages/tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl
Index: packages/tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl
+++ packages/tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl
@@ -0,0 +1,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/win32-x86/Garuda1.0/pkgIndex.tcl.asc
Index: packages/tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl.asc
==================================================================
--- packages/tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl.asc
+++ packages/tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl.asc
@@ -0,0 +1,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-----
DELETED tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe
Index: tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe
==================================================================
--- tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe
+++ tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe
cannot compute difference between binary files
DELETED tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe.asc
Index: tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe.asc
==================================================================
--- tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe.asc
+++ tcl/8.4/msil/HelloWorld1.0/HelloWorld.exe.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJZWApqAAoJEFAslq9JXcLZWOgQAJ0P2QOQDgd8LBDsqhFwFfTk
-TyNHi3xRKb1TOtHhIRip5kgH9sn6jSE8VqMU8MJuKpPaWCaZraZ9CyL0PzMqF3gh
-u/8YFMW82evxcaVxue7BzNnha6YJyIXsLb6Uc0lDK8yU9szKm4qq/Y6czptij1Nl
-/dUswLLUwPN785jtC05MkJLVL32DvfatmoVAYHAS3Cvva0S6P/kEmAJC4G0wOyIK
-Rl7NpCOsq3re//LVbXc7dgZox6lS/fCwuqiQAK08Tbv8JxpCKJerNpFvXpBbEU4J
-n7HDcgc2QuKGwLPPmmnZvW6ymrrq0dFCa3tJQTDN+JmpgE8GddyNA9FQN+qtIA7i
-sV9FziRAN4whZxcA54Ev2nf0R8m4Mga4/x6sMN0WJUHkXWzi7gMvvu8/bC3U/Vfu
-iMLLTnIKcHUTuUS80AizJsU3BxEzWvcwxoSl08n4+jAdZoq0KAwHBOZ4AugYT6ap
-fYTb6IxOfQFfzMQo8vZ+IVB6n2t24x3hfK5RZsPRPxsybkPNmBhjsIyXkzf/wX3Q
-HIAb61vdNnf2+stNfjhtfNvMlOzt2RRjixC3fETfgSfSMjeXmupHD7ANDwZJXCQ7
-teBO92JGiYqZk8Emh6OdedxqYi5WI9RE5t2HhMlSq52hjlS3HvsnpDv2mUbL1BNx
-ph7yruPtktPzhGfN9SiG
-=Ezfd
------END PGP SIGNATURE-----
DELETED tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl
Index: tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl
==================================================================
--- tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl
+++ tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl
@@ -1,26 +0,0 @@
-###############################################################################
-#
-# 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 HelloWorld 1.0 [list apply [list { dir } {
- set command [list exec]
- if {![isWindows]} then {lappend command mono}
- lappend command [file join $dir HelloWorld.exe]
- puts stdout [eval $command]
- package provide HelloWorld 1.0
-}] $dir]
DELETED tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl.asc
Index: tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl.asc
==================================================================
--- tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl.asc
+++ tcl/8.4/msil/HelloWorld1.0/pkgIndex.tcl.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJZWBTcAAoJEFAslq9JXcLZB7sQAIWnK+RKMFG58dAS83y3V3Pn
-p4iLIA3qihBH1PuBRqdNdyOdx3OtnAjX4sqaK+wb0cUYu0VuzkHWWw4bp5dFe1S7
-c+4I35rutxtXFtrszyHBbZ4PvNFkm40VL+ayoGsPCCLtXogHJkFaUg9ySR4UPDbW
-4kOJ9ScriUl+EPiyLHDYmS69EyVjuVJ2kyqTLVtyuQTv2woQfLTXuxkjBcdjeAwJ
-pU9HWqOP2caGhPMcPKMmWxhd3mMfqYQd3FFtJJl22k49bc9x48IFJoobaGjabWZf
-HkL7+kMdODExIdsrqGcbrztbghhdlgr2iDDKyc23pz9fLN6T7j/uR6wL7HgT5WA2
-yv0HU0IqmuqRI2KlCOkLGzw6v1XFsDtUT+83VKFY05zSIV3B1S8yHVlZ3/I2eyOK
-+O3suL/wfeIPNfM0M6/nT6tSo9A7fc2ZM6XCOqU2bzAK/N/iqSKi2/0ePvBfC5wL
-iT20acFgDpAVyTmtGeQeZ6CIJIcsMnFQ66uALBk0NS79wfJqxra2fdrLXtauIjP4
-As8BL8gHBbIqY/OOI9BHpIwsnen4QLZAHwc0uMH9VwB9hIG4IeYOF9qcIAS3Mea/
-TYiDH3HovgDZqvmFvamneNO7IMdkiKEBEa78KOvveJuxSCrNxqccmCtOoRP/oD44
-fYzxOCEFXyTuOKpinIRk
-=ogyF
------END PGP SIGNATURE-----
DELETED tcl/8.4/neutral/tcllib1.15/aes/aes.tcl
Index: tcl/8.4/neutral/tcllib1.15/aes/aes.tcl
==================================================================
--- tcl/8.4/neutral/tcllib1.15/aes/aes.tcl
+++ tcl/8.4/neutral/tcllib1.15/aes/aes.tcl
@@ -1,628 +0,0 @@
-# aes.tcl -
-#
-# Copyright (c) 2005 Thorsten Schloermann
-# Copyright (c) 2005 Pat Thoyts
-# Copyright (c) 2013 Andreas Kupries
-#
-# A Tcl implementation of the Advanced Encryption Standard (US FIPS PUB 197)
-#
-# AES is a block cipher with a block size of 128 bits and a variable
-# key size of 128, 192 or 256 bits.
-# The algorithm works on each block as a 4x4 state array. There are 4 steps
-# in each round:
-# SubBytes a non-linear substitution step using a predefined S-box
-# ShiftRows cyclic transposition of rows in the state matrix
-# MixColumns transformation upon columns in the state matrix
-# AddRoundKey application of round specific sub-key
-#
-# -------------------------------------------------------------------------
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-# -------------------------------------------------------------------------
-
-package require Tcl 8.2
-
-namespace eval ::aes {
- variable version 1.1.1
- variable rcsid {$Id: aes.tcl,v 1.7 2010/07/06 19:39:00 andreas_kupries Exp $}
- variable uid ; if {![info exists uid]} { set uid 0 }
-
- namespace export {aes}
-
- # constants
-
- # S-box
- variable sbox {
- 0x63 0x7c 0x77 0x7b 0xf2 0x6b 0x6f 0xc5 0x30 0x01 0x67 0x2b 0xfe 0xd7 0xab 0x76
- 0xca 0x82 0xc9 0x7d 0xfa 0x59 0x47 0xf0 0xad 0xd4 0xa2 0xaf 0x9c 0xa4 0x72 0xc0
- 0xb7 0xfd 0x93 0x26 0x36 0x3f 0xf7 0xcc 0x34 0xa5 0xe5 0xf1 0x71 0xd8 0x31 0x15
- 0x04 0xc7 0x23 0xc3 0x18 0x96 0x05 0x9a 0x07 0x12 0x80 0xe2 0xeb 0x27 0xb2 0x75
- 0x09 0x83 0x2c 0x1a 0x1b 0x6e 0x5a 0xa0 0x52 0x3b 0xd6 0xb3 0x29 0xe3 0x2f 0x84
- 0x53 0xd1 0x00 0xed 0x20 0xfc 0xb1 0x5b 0x6a 0xcb 0xbe 0x39 0x4a 0x4c 0x58 0xcf
- 0xd0 0xef 0xaa 0xfb 0x43 0x4d 0x33 0x85 0x45 0xf9 0x02 0x7f 0x50 0x3c 0x9f 0xa8
- 0x51 0xa3 0x40 0x8f 0x92 0x9d 0x38 0xf5 0xbc 0xb6 0xda 0x21 0x10 0xff 0xf3 0xd2
- 0xcd 0x0c 0x13 0xec 0x5f 0x97 0x44 0x17 0xc4 0xa7 0x7e 0x3d 0x64 0x5d 0x19 0x73
- 0x60 0x81 0x4f 0xdc 0x22 0x2a 0x90 0x88 0x46 0xee 0xb8 0x14 0xde 0x5e 0x0b 0xdb
- 0xe0 0x32 0x3a 0x0a 0x49 0x06 0x24 0x5c 0xc2 0xd3 0xac 0x62 0x91 0x95 0xe4 0x79
- 0xe7 0xc8 0x37 0x6d 0x8d 0xd5 0x4e 0xa9 0x6c 0x56 0xf4 0xea 0x65 0x7a 0xae 0x08
- 0xba 0x78 0x25 0x2e 0x1c 0xa6 0xb4 0xc6 0xe8 0xdd 0x74 0x1f 0x4b 0xbd 0x8b 0x8a
- 0x70 0x3e 0xb5 0x66 0x48 0x03 0xf6 0x0e 0x61 0x35 0x57 0xb9 0x86 0xc1 0x1d 0x9e
- 0xe1 0xf8 0x98 0x11 0x69 0xd9 0x8e 0x94 0x9b 0x1e 0x87 0xe9 0xce 0x55 0x28 0xdf
- 0x8c 0xa1 0x89 0x0d 0xbf 0xe6 0x42 0x68 0x41 0x99 0x2d 0x0f 0xb0 0x54 0xbb 0x16
- }
- # inverse S-box
- variable xobs {
- 0x52 0x09 0x6a 0xd5 0x30 0x36 0xa5 0x38 0xbf 0x40 0xa3 0x9e 0x81 0xf3 0xd7 0xfb
- 0x7c 0xe3 0x39 0x82 0x9b 0x2f 0xff 0x87 0x34 0x8e 0x43 0x44 0xc4 0xde 0xe9 0xcb
- 0x54 0x7b 0x94 0x32 0xa6 0xc2 0x23 0x3d 0xee 0x4c 0x95 0x0b 0x42 0xfa 0xc3 0x4e
- 0x08 0x2e 0xa1 0x66 0x28 0xd9 0x24 0xb2 0x76 0x5b 0xa2 0x49 0x6d 0x8b 0xd1 0x25
- 0x72 0xf8 0xf6 0x64 0x86 0x68 0x98 0x16 0xd4 0xa4 0x5c 0xcc 0x5d 0x65 0xb6 0x92
- 0x6c 0x70 0x48 0x50 0xfd 0xed 0xb9 0xda 0x5e 0x15 0x46 0x57 0xa7 0x8d 0x9d 0x84
- 0x90 0xd8 0xab 0x00 0x8c 0xbc 0xd3 0x0a 0xf7 0xe4 0x58 0x05 0xb8 0xb3 0x45 0x06
- 0xd0 0x2c 0x1e 0x8f 0xca 0x3f 0x0f 0x02 0xc1 0xaf 0xbd 0x03 0x01 0x13 0x8a 0x6b
- 0x3a 0x91 0x11 0x41 0x4f 0x67 0xdc 0xea 0x97 0xf2 0xcf 0xce 0xf0 0xb4 0xe6 0x73
- 0x96 0xac 0x74 0x22 0xe7 0xad 0x35 0x85 0xe2 0xf9 0x37 0xe8 0x1c 0x75 0xdf 0x6e
- 0x47 0xf1 0x1a 0x71 0x1d 0x29 0xc5 0x89 0x6f 0xb7 0x62 0x0e 0xaa 0x18 0xbe 0x1b
- 0xfc 0x56 0x3e 0x4b 0xc6 0xd2 0x79 0x20 0x9a 0xdb 0xc0 0xfe 0x78 0xcd 0x5a 0xf4
- 0x1f 0xdd 0xa8 0x33 0x88 0x07 0xc7 0x31 0xb1 0x12 0x10 0x59 0x27 0x80 0xec 0x5f
- 0x60 0x51 0x7f 0xa9 0x19 0xb5 0x4a 0x0d 0x2d 0xe5 0x7a 0x9f 0x93 0xc9 0x9c 0xef
- 0xa0 0xe0 0x3b 0x4d 0xae 0x2a 0xf5 0xb0 0xc8 0xeb 0xbb 0x3c 0x83 0x53 0x99 0x61
- 0x17 0x2b 0x04 0x7e 0xba 0x77 0xd6 0x26 0xe1 0x69 0x14 0x63 0x55 0x21 0x0c 0x7d
- }
-}
-
-# aes::Init --
-#
-# Initialise our AES state and calculate the key schedule. An initialization
-# vector is maintained in the state for modes that require one. The key must
-# be binary data of the correct size and the IV must be 16 bytes.
-#
-# Nk: columns of the key-array
-# Nr: number of rounds (depends on key-length)
-# Nb: columns of the text-block, is always 4 in AES
-#
-proc ::aes::Init {mode key iv} {
- switch -exact -- $mode {
- ecb - cbc { }
- cfb - ofb {
- return -code error "$mode mode not implemented"
- }
- default {
- return -code error "invalid mode \"$mode\":\
- must be one of ecb or cbc."
- }
- }
-
- set size [expr {[string length $key] << 3}]
- switch -exact -- $size {
- 128 {set Nk 4; set Nr 10; set Nb 4}
- 192 {set Nk 6; set Nr 12; set Nb 4}
- 256 {set Nk 8; set Nr 14; set Nb 4}
- default {
- return -code error "invalid key size \"$size\":\
- must be one of 128, 192 or 256."
- }
- }
-
- variable uid
- set Key [namespace current]::[incr uid]
- upvar #0 $Key state
- array set state [list M $mode K $key I $iv Nk $Nk Nr $Nr Nb $Nb W {}]
- ExpandKey $Key
- return $Key
-}
-
-# aes::Reset --
-#
-# Reset the initialization vector for the specified key. This permits the
-# key to be reused for encryption or decryption without the expense of
-# re-calculating the key schedule.
-#
-proc ::aes::Reset {Key iv} {
- upvar #0 $Key state
- set state(I) $iv
- return
-}
-
-# aes::Final --
-#
-# Clean up the key state
-#
-proc ::aes::Final {Key} {
- # FRINK: nocheck
- unset $Key
-}
-
-# -------------------------------------------------------------------------
-
-# 5.1 Cipher: Encipher a single block of 128 bits.
-proc ::aes::EncryptBlock {Key block} {
- upvar #0 $Key state
- if {[binary scan $block I4 data] != 1} {
- return -code error "invalid block size: blocks must be 16 bytes"
- }
-
- if {[string equal $state(M) cbc]} {
- if {[binary scan $state(I) I4 iv] != 1} {
- return -code error "invalid initialization vector: must be 16 bytes"
- }
- for {set n 0} {$n < 4} {incr n} {
- lappend data2 [expr {0xffffffff & ([lindex $data $n] ^ [lindex $iv $n])}]
- }
- set data $data2
- }
-
- set data [AddRoundKey $Key 0 $data]
- for {set n 1} {$n < $state(Nr)} {incr n} {
- set data [AddRoundKey $Key $n [MixColumns [ShiftRows [SubBytes $data]]]]
- }
- set data [AddRoundKey $Key $n [ShiftRows [SubBytes $data]]]
-
- # Bug 2993029:
- # Force all elements of data into the 32bit range.
- set res {}
- foreach d $data {
- lappend res [expr {$d & 0xffffffff}]
- }
- set data $res
-
- return [set state(I) [binary format I4 $data]]
-}
-
-# 5.3: Inverse Cipher: Decipher a single 128 bit block.
-proc ::aes::DecryptBlock {Key block} {
- upvar #0 $Key state
- if {[binary scan $block I4 data] != 1} {
- return -code error "invalid block size: block must be 16 bytes"
- }
-
- set n $state(Nr)
- set data [AddRoundKey $Key $state(Nr) $data]
- for {incr n -1} {$n > 0} {incr n -1} {
- set data [InvMixColumns [AddRoundKey $Key $n [InvSubBytes [InvShiftRows $data]]]]
- }
- set data [AddRoundKey $Key $n [InvSubBytes [InvShiftRows $data]]]
-
- if {[string equal $state(M) cbc]} {
- if {[binary scan $state(I) I4 iv] != 1} {
- return -code error "invalid initialization vector: must be 16 bytes"
- }
- for {set n 0} {$n < 4} {incr n} {
- lappend data2 [expr {0xffffffff & ([lindex $data $n] ^ [lindex $iv $n])}]
- }
- set data $data2
- } else {
- # Bug 2993029:
- # Force all elements of data into the 32bit range.
- # The trimming we see above only happens for CBC mode.
- set res {}
- foreach d $data {
- lappend res [expr {$d & 0xffffffff}]
- }
- set data $res
- }
-
- set state(I) $block
- return [binary format I4 $data]
-}
-
-# 5.2: KeyExpansion
-proc ::aes::ExpandKey {Key} {
- upvar #0 $Key state
- set Rcon [list 0x00000000 0x01000000 0x02000000 0x04000000 0x08000000 \
- 0x10000000 0x20000000 0x40000000 0x80000000 0x1b000000 \
- 0x36000000 0x6c000000 0xd8000000 0xab000000 0x4d000000]
- # Split the key into Nk big-endian words
- binary scan $state(K) I* W
- set max [expr {$state(Nb) * ($state(Nr) + 1)}]
- set i $state(Nk)
- set h $state(Nk) ; incr h -1
- set j 0
- for {} {$i < $max} {incr i; incr h; incr j} {
- set temp [lindex $W $h]
- if {($i % $state(Nk)) == 0} {
- set sub [SubWord [RotWord $temp]]
- set rc [lindex $Rcon [expr {$i/$state(Nk)}]]
- set temp [expr {$sub ^ $rc}]
- } elseif {$state(Nk) > 6 && ($i % $state(Nk)) == 4} {
- set temp [SubWord $temp]
- }
- lappend W [expr {[lindex $W $j] ^ $temp}]
- }
- set state(W) $W
- return
-}
-
-# 5.2: Key Expansion: Apply S-box to each byte in the 32 bit word
-proc ::aes::SubWord {w} {
- variable sbox
- set s3 [lindex $sbox [expr {(($w >> 24) & 255)}]]
- set s2 [lindex $sbox [expr {(($w >> 16) & 255)}]]
- set s1 [lindex $sbox [expr {(($w >> 8 ) & 255)}]]
- set s0 [lindex $sbox [expr {( $w & 255)}]]
- return [expr {($s3 << 24) | ($s2 << 16) | ($s1 << 8) | $s0}]
-}
-
-proc ::aes::InvSubWord {w} {
- variable xobs
- set s3 [lindex $xobs [expr {(($w >> 24) & 255)}]]
- set s2 [lindex $xobs [expr {(($w >> 16) & 255)}]]
- set s1 [lindex $xobs [expr {(($w >> 8 ) & 255)}]]
- set s0 [lindex $xobs [expr {( $w & 255)}]]
- return [expr {($s3 << 24) | ($s2 << 16) | ($s1 << 8) | $s0}]
-}
-
-# 5.2: Key Expansion: Rotate a 32bit word by 8 bits
-proc ::aes::RotWord {w} {
- return [expr {(($w << 8) | (($w >> 24) & 0xff)) & 0xffffffff}]
-}
-
-# 5.1.1: SubBytes() Transformation
-proc ::aes::SubBytes {words} {
- set r {}
- foreach w $words {
- lappend r [SubWord $w]
- }
- return $r
-}
-
-# 5.3.2: InvSubBytes() Transformation
-proc ::aes::InvSubBytes {words} {
- set r {}
- foreach w $words {
- lappend r [InvSubWord $w]
- }
- return $r
-}
-
-# 5.1.2: ShiftRows() Transformation
-proc ::aes::ShiftRows {words} {
- for {set n0 0} {$n0 < 4} {incr n0} {
- set n1 [expr {($n0 + 1) % 4}]
- set n2 [expr {($n0 + 2) % 4}]
- set n3 [expr {($n0 + 3) % 4}]
- lappend r [expr {( [lindex $words $n0] & 0xff000000)
- | ([lindex $words $n1] & 0x00ff0000)
- | ([lindex $words $n2] & 0x0000ff00)
- | ([lindex $words $n3] & 0x000000ff)
- }]
- }
- return $r
-}
-
-
-# 5.3.1: InvShiftRows() Transformation
-proc ::aes::InvShiftRows {words} {
- for {set n0 0} {$n0 < 4} {incr n0} {
- set n1 [expr {($n0 + 1) % 4}]
- set n2 [expr {($n0 + 2) % 4}]
- set n3 [expr {($n0 + 3) % 4}]
- lappend r [expr {( [lindex $words $n0] & 0xff000000)
- | ([lindex $words $n3] & 0x00ff0000)
- | ([lindex $words $n2] & 0x0000ff00)
- | ([lindex $words $n1] & 0x000000ff)
- }]
- }
- return $r
-}
-
-# 5.1.3: MixColumns() Transformation
-proc ::aes::MixColumns {words} {
- set r {}
- foreach w $words {
- set r0 [expr {(($w >> 24) & 255)}]
- set r1 [expr {(($w >> 16) & 255)}]
- set r2 [expr {(($w >> 8 ) & 255)}]
- set r3 [expr {( $w & 255)}]
-
- set s0 [expr {[GFMult2 $r0] ^ [GFMult3 $r1] ^ $r2 ^ $r3}]
- set s1 [expr {$r0 ^ [GFMult2 $r1] ^ [GFMult3 $r2] ^ $r3}]
- set s2 [expr {$r0 ^ $r1 ^ [GFMult2 $r2] ^ [GFMult3 $r3]}]
- set s3 [expr {[GFMult3 $r0] ^ $r1 ^ $r2 ^ [GFMult2 $r3]}]
-
- lappend r [expr {($s0 << 24) | ($s1 << 16) | ($s2 << 8) | $s3}]
- }
- return $r
-}
-
-# 5.3.3: InvMixColumns() Transformation
-proc ::aes::InvMixColumns {words} {
- set r {}
- foreach w $words {
- set r0 [expr {(($w >> 24) & 255)}]
- set r1 [expr {(($w >> 16) & 255)}]
- set r2 [expr {(($w >> 8 ) & 255)}]
- set r3 [expr {( $w & 255)}]
-
- set s0 [expr {[GFMult0e $r0] ^ [GFMult0b $r1] ^ [GFMult0d $r2] ^ [GFMult09 $r3]}]
- set s1 [expr {[GFMult09 $r0] ^ [GFMult0e $r1] ^ [GFMult0b $r2] ^ [GFMult0d $r3]}]
- set s2 [expr {[GFMult0d $r0] ^ [GFMult09 $r1] ^ [GFMult0e $r2] ^ [GFMult0b $r3]}]
- set s3 [expr {[GFMult0b $r0] ^ [GFMult0d $r1] ^ [GFMult09 $r2] ^ [GFMult0e $r3]}]
-
- lappend r [expr {($s0 << 24) | ($s1 << 16) | ($s2 << 8) | $s3}]
- }
- return $r
-}
-
-# 5.1.4: AddRoundKey() Transformation
-proc ::aes::AddRoundKey {Key round words} {
- upvar #0 $Key state
- set r {}
- set n [expr {$round * $state(Nb)}]
- foreach w $words {
- lappend r [expr {$w ^ [lindex $state(W) $n]}]
- incr n
- }
- return $r
-}
-
-# -------------------------------------------------------------------------
-# ::aes::GFMult*
-#
-# some needed functions for multiplication in a Galois-field
-#
-proc ::aes::GFMult2 {number} {
- # this is a tabular representation of xtime (multiplication by 2)
- # it is used instead of calculation to prevent timing attacks
- set xtime {
- 0x00 0x02 0x04 0x06 0x08 0x0a 0x0c 0x0e 0x10 0x12 0x14 0x16 0x18 0x1a 0x1c 0x1e
- 0x20 0x22 0x24 0x26 0x28 0x2a 0x2c 0x2e 0x30 0x32 0x34 0x36 0x38 0x3a 0x3c 0x3e
- 0x40 0x42 0x44 0x46 0x48 0x4a 0x4c 0x4e 0x50 0x52 0x54 0x56 0x58 0x5a 0x5c 0x5e
- 0x60 0x62 0x64 0x66 0x68 0x6a 0x6c 0x6e 0x70 0x72 0x74 0x76 0x78 0x7a 0x7c 0x7e
- 0x80 0x82 0x84 0x86 0x88 0x8a 0x8c 0x8e 0x90 0x92 0x94 0x96 0x98 0x9a 0x9c 0x9e
- 0xa0 0xa2 0xa4 0xa6 0xa8 0xaa 0xac 0xae 0xb0 0xb2 0xb4 0xb6 0xb8 0xba 0xbc 0xbe
- 0xc0 0xc2 0xc4 0xc6 0xc8 0xca 0xcc 0xce 0xd0 0xd2 0xd4 0xd6 0xd8 0xda 0xdc 0xde
- 0xe0 0xe2 0xe4 0xe6 0xe8 0xea 0xec 0xee 0xf0 0xf2 0xf4 0xf6 0xf8 0xfa 0xfc 0xfe
- 0x1b 0x19 0x1f 0x1d 0x13 0x11 0x17 0x15 0x0b 0x09 0x0f 0x0d 0x03 0x01 0x07 0x05
- 0x3b 0x39 0x3f 0x3d 0x33 0x31 0x37 0x35 0x2b 0x29 0x2f 0x2d 0x23 0x21 0x27 0x25
- 0x5b 0x59 0x5f 0x5d 0x53 0x51 0x57 0x55 0x4b 0x49 0x4f 0x4d 0x43 0x41 0x47 0x45
- 0x7b 0x79 0x7f 0x7d 0x73 0x71 0x77 0x75 0x6b 0x69 0x6f 0x6d 0x63 0x61 0x67 0x65
- 0x9b 0x99 0x9f 0x9d 0x93 0x91 0x97 0x95 0x8b 0x89 0x8f 0x8d 0x83 0x81 0x87 0x85
- 0xbb 0xb9 0xbf 0xbd 0xb3 0xb1 0xb7 0xb5 0xab 0xa9 0xaf 0xad 0xa3 0xa1 0xa7 0xa5
- 0xdb 0xd9 0xdf 0xdd 0xd3 0xd1 0xd7 0xd5 0xcb 0xc9 0xcf 0xcd 0xc3 0xc1 0xc7 0xc5
- 0xfb 0xf9 0xff 0xfd 0xf3 0xf1 0xf7 0xf5 0xeb 0xe9 0xef 0xed 0xe3 0xe1 0xe7 0xe5
- }
- return [lindex $xtime $number]
-}
-
-proc ::aes::GFMult3 {number} {
- # multliply by 2 (via GFMult2) and add the number again on the result (via XOR)
- return [expr {$number ^ [GFMult2 $number]}]
-}
-
-proc ::aes::GFMult09 {number} {
- # 09 is: (02*02*02) + 01
- return [expr {[GFMult2 [GFMult2 [GFMult2 $number]]] ^ $number}]
-}
-
-proc ::aes::GFMult0b {number} {
- # 0b is: (02*02*02) + 02 + 01
- #return [expr [GFMult2 [GFMult2 [GFMult2 $number]]] ^ [GFMult2 $number] ^ $number]
- #set g0 [GFMult2 $number]
- return [expr {[GFMult09 $number] ^ [GFMult2 $number]}]
-}
-
-proc ::aes::GFMult0d {number} {
- # 0d is: (02*02*02) + (02*02) + 01
- set temp [GFMult2 [GFMult2 $number]]
- return [expr {[GFMult2 $temp] ^ ($temp ^ $number)}]
-}
-
-proc ::aes::GFMult0e {number} {
- # 0e is: (02*02*02) + (02*02) + 02
- set temp [GFMult2 [GFMult2 $number]]
- return [expr {[GFMult2 $temp] ^ ($temp ^ [GFMult2 $number])}]
-}
-
-# -------------------------------------------------------------------------
-
-# aes::Encrypt --
-#
-# Encrypt a blocks of plain text and returns blocks of cipher text.
-# The input data must be a multiple of the block size (16).
-#
-proc ::aes::Encrypt {Key data} {
- set len [string length $data]
- if {($len % 16) != 0} {
- return -code error "invalid block size: AES requires 16 byte blocks"
- }
-
- set result {}
- for {set i 0} {$i < $len} {incr i 1} {
- set block [string range $data $i [incr i 15]]
- append result [EncryptBlock $Key $block]
- }
- return $result
-}
-
-# aes::DecryptBlock --
-#
-# Decrypt a blocks of cipher text and returns blocks of plain text.
-# The input data must be a multiple of the block size (16).
-#
-proc ::aes::Decrypt {Key data} {
- set len [string length $data]
- if {($len % 16) != 0} {
- return -code error "invalid block size: AES requires 16 byte blocks"
- }
-
- set result {}
- for {set i 0} {$i < $len} {incr i 1} {
- set block [string range $data $i [incr i 15]]
- append result [DecryptBlock $Key $block]
- }
- return $result
-}
-
-# -------------------------------------------------------------------------
-# Fileevent handler for chunked file reading.
-#
-proc ::aes::Chunk {Key in {out {}} {chunksize 4096}} {
- upvar #0 $Key state
-
- #puts ||CHUNK.X||i=$in|o=$out|c=$chunksize|eof=[eof $in]
-
- if {[eof $in]} {
- fileevent $in readable {}
- set state(reading) 0
- }
-
- set data [read $in $chunksize]
-
- #puts ||CHUNK.R||i=$in|o=$out|c=$chunksize|eof=[eof $in]||[string length $data]||$data||
-
- # Do nothing when data was read at all.
- if {![string length $data]} return
-
- if {[eof $in]} {
- #puts CHUNK.Z
- set data [Pad $data 16]
- }
-
- #puts ||CHUNK.P||i=$in|o=$out|c=$chunksize|eof=[eof $in]||[string length $data]||$data||
-
- if {$out == {}} {
- append state(output) [$state(cmd) $Key $data]
- } else {
- puts -nonewline $out [$state(cmd) $Key $data]
- }
-}
-
-proc ::aes::SetOneOf {lst item} {
- set ndx [lsearch -glob $lst "${item}*"]
- if {$ndx == -1} {
- set err [join $lst ", "]
- return -code error "invalid mode \"$item\": must be one of $err"
- }
- return [lindex $lst $ndx]
-}
-
-proc ::aes::CheckSize {what size thing} {
- if {[string length $thing] != $size} {
- return -code error "invalid value for $what: must be $size bytes long"
- }
- return $thing
-}
-
-proc ::aes::Pad {data blocksize {fill \0}} {
- set len [string length $data]
- if {$len == 0} {
- set data [string repeat $fill $blocksize]
- } elseif {($len % $blocksize) != 0} {
- set pad [expr {$blocksize - ($len % $blocksize)}]
- append data [string repeat $fill $pad]
- }
- return $data
-}
-
-proc ::aes::Pop {varname {nth 0}} {
- upvar 1 $varname args
- set r [lindex $args $nth]
- set args [lreplace $args $nth $nth]
- return $r
-}
-
-proc ::aes::Hex {data} {
- binary scan $data H* r
- return $r
-}
-
-proc ::aes::aes {args} {
- array set opts {-dir encrypt -mode cbc -key {} -in {} -out {} -chunksize 4096 -hex 0}
- set opts(-iv) [string repeat \0 16]
- set modes {ecb cbc}
- set dirs {encrypt decrypt}
- while {([llength $args] > 1) && [string match -* [set option [lindex $args 0]]]} {
- switch -exact -- $option {
- -mode { set opts(-mode) [SetOneOf $modes [Pop args 1]] }
- -dir { set opts(-dir) [SetOneOf $dirs [Pop args 1]] }
- -iv { set opts(-iv) [CheckSize -iv 16 [Pop args 1]] }
- -key { set opts(-key) [Pop args 1] }
- -in { set opts(-in) [Pop args 1] }
- -out { set opts(-out) [Pop args 1] }
- -chunksize { set opts(-chunksize) [Pop args 1] }
- -hex { set opts(-hex) 1 }
- -- { Pop args ; break }
- default {
- set err [join [lsort [array names opts]] ", "]
- return -code error "bad option \"$option\":\
- must be one of $err"
- }
- }
- Pop args
- }
-
- if {$opts(-key) == {}} {
- return -code error "no key provided: the -key option is required"
- }
-
- set r {}
- if {$opts(-in) == {}} {
-
- if {[llength $args] != 1} {
- return -code error "wrong \# args:\
- should be \"aes ?options...? -key keydata plaintext\""
- }
-
- set data [Pad [lindex $args 0] 16]
- set Key [Init $opts(-mode) $opts(-key) $opts(-iv)]
- if {[string equal $opts(-dir) "encrypt"]} {
- set r [Encrypt $Key $data]
- } else {
- set r [Decrypt $Key $data]
- }
-
- if {$opts(-out) != {}} {
- puts -nonewline $opts(-out) $r
- set r {}
- }
- Final $Key
-
- } else {
-
- if {[llength $args] != 0} {
- return -code error "wrong \# args:\
- should be \"aes ?options...? -key keydata -in channel\""
- }
-
- set Key [Init $opts(-mode) $opts(-key) $opts(-iv)]
-
- set readcmd [list [namespace origin Chunk] \
- $Key $opts(-in) $opts(-out) \
- $opts(-chunksize)]
-
- upvar 1 $Key state
- set state(reading) 1
- if {[string equal $opts(-dir) "encrypt"]} {
- set state(cmd) Encrypt
- } else {
- set state(cmd) Decrypt
- }
- set state(output) ""
- fileevent $opts(-in) readable $readcmd
- if {[info commands ::tkwait] != {}} {
- tkwait variable [subst $Key](reading)
- } else {
- vwait [subst $Key](reading)
- }
- if {$opts(-out) == {}} {
- set r $state(output)
- }
- Final $Key
- }
-
- if {$opts(-hex)} {
- set r [Hex $r]
- }
- return $r
-}
-
-# -------------------------------------------------------------------------
-
-package provide aes $::aes::version
-
-# -------------------------------------------------------------------------
-# Local variables:
-# mode: tcl
-# indent-tabs-mode: nil
-# End:
DELETED tcl/8.4/neutral/tcllib1.15/aes/aes.tcl.asc
Index: tcl/8.4/neutral/tcllib1.15/aes/aes.tcl.asc
==================================================================
--- tcl/8.4/neutral/tcllib1.15/aes/aes.tcl.asc
+++ tcl/8.4/neutral/tcllib1.15/aes/aes.tcl.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJXtl6FAAoJEFAslq9JXcLZenMQAKEdxioTYCPWs5wEYERfn/8x
-GklZUR/LGTNV0w0JO13BxwUsrwOC0BMI3iRhFGBNyd6J7RqkvulbfEADdzZoTofF
-INfhpT+sJoXScmg1pzcJmZdUGP7vBmG6+askcVSkafZmesp6DR03lPI3x323A6dm
-kJPIy87UMCB+g2L+V/+BhWJgrQloekWNUKsElcWBc3N+K3lWbx48jgkcLow5K2St
-qg0paqW5T6doT6Ig27JKy71SRreMi2OsJs/HA+KxND9diC2hfVC87dkVGyoKHOJG
-fsX6j+Fz3Eygg7sw+U3EIIMOj/eQiWZJ/eCn1UbxvCcGORHiQnDztTpfEIETM+dz
-TNAvjWlC2ISDDJAyc1C02ok+ee+6chfJhe8aH9Fj/AK4tmJ9xXyF6FMz0yZ/F/3k
-LCggJlO0eVnngjwDwGuz6czJ7VccRDgwdXtpkMJtq4yJtZOHaoYXUr6fgGoW4i3r
-yOQu2Ajk/ZU9l8tTXbXWhexn+x+TbbhLUuOckEu8Mk7ID+Z2EMA4AyzvfwytbCbk
-8Wi4J0gDa/cV2JvncQAlcZ6u+4mgWhMyUg8gq2bMsYwJd6/8XzEIaF4752UFiUiV
-AeOdPeGeqfELAlUagLAQOuHiFAK22VU0jPTp0f8MNvSITdheI7EeUNY7gM0a7odI
-hf4M9GphdltjwhC1p4FI
-=kVUR
------END PGP SIGNATURE-----
DELETED tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl
Index: tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl
==================================================================
--- tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl
+++ tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl
@@ -1,5 +0,0 @@
-if {![package vsatisfies [package provide Tcl] 8.2]} {
- # PRAGMA: returnok
- return
-}
-package ifneeded aes 1.1.1 [list source [file join $dir aes.tcl]]
DELETED tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl.asc
Index: tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl.asc
==================================================================
--- tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl.asc
+++ tcl/8.4/neutral/tcllib1.15/aes/pkgIndex.tcl.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJXtl6JAAoJEFAslq9JXcLZSf4QAKFsBhYHqlALRprs1hhXArfc
-jamjLJCUFZRrsU1exvmbiU/2SCsFwveL8gDHtRGvHrKZpepVSSh1vAK1DFAEW5zR
-2/bnMRnmYKfbdmLe7bd8xZqRDQjgMRIq/rs5Op9bgb+AstasiQLbjvNNJt2Q56d0
-wYWSH4w5qkniJSfakXSf+4HyFcU8kSG+rvkqOqGrKqQTY0DhJVTsjAZHA6+gE3T+
-xx6mUXiJjrnU429pht4mry5d8bSEIbARYi6B9AIbaboqlgcDTaMTmNpHRDpVx+VO
-F1Q/JtRsI0tMvbMhHFITzOVP+HyEax1tTm+bMArdnYvECvawwQ+rG7IudNFInZPE
-EXNg+qunEUpcR+bgdhnQDqZDpslmA4ZThIxDRyAYwx6e1NddVF3uhdL2/Fatdmrs
-WS1HwzZFN5nQtnKo0l9yTnp3TAo2Zjx9HhEQNo5zMAzFy5bnLrIbz2xSRL9xBIJ9
-N4EtBvPWW+IKfyLxz/mP5dkYrhUDvAxbThsR/li2HI3dhwfU7aSXVkuBMDBvrklz
-8W3SHNcTHDeoB5dE9z4JTSKgZoxKBQwD5dstsSbYeykxuHVBcjL1EkLjr1iCduIu
-NBCPuaLpxEEVREyN3QeHObH4+QrXPKsgE8sm5V6a2rVyfS6koBAOX+eDIlfXdo8N
-B0KCHquWJYaanWwDdOTK
-=53sI
------END PGP SIGNATURE-----
DELETED tcl/8.4/win32-x86/Garuda1.0/Garuda.dll
Index: tcl/8.4/win32-x86/Garuda1.0/Garuda.dll
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/Garuda.dll
+++ tcl/8.4/win32-x86/Garuda1.0/Garuda.dll
cannot compute difference between binary files
DELETED tcl/8.4/win32-x86/Garuda1.0/Garuda.dll.asc
Index: tcl/8.4/win32-x86/Garuda1.0/Garuda.dll.asc
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/Garuda.dll.asc
+++ tcl/8.4/win32-x86/Garuda1.0/Garuda.dll.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJYHke4AAoJEFAslq9JXcLZOsoP/RuN+mN8tuf7oSMJIsuRP8zt
-/fvI/9avl8IqUhe8Z5NOx5SEMCBkpJn9WFB+goGYCs8F1BK2FHzYsk/RkaiL3swk
-4hfJO+miUOqak1p8q/mTsJHkAaIxebMxRm78/ZN8Zh9m5q/4xBuVV52jVmyDaDd2
-1Jihu8E0pBSl4G65HnAyiBEPV0EQiQAJz2fuHoDfsg0tHoLYR+UJbPhpqVO9Q5to
-T9ZHNjJLb8ReI5TUHk/sfBYMHx595R0wzXF2DTMO8H52O8pqTFHJzYyi0jtLLEfn
-UFxEiVueDVKCjNEvi83xWm/jO2pU1W/6TnPnjpj3fyLw7Ve/I1whZx1uM8kKSxjp
-uRkHT/w9zof3c68r1neg0oOwBKMLIL4gbHOeaPwvvEqC9diNuM9LR6JhyqFMU60C
-VSvYKjfD7cBc/81MMZSJ2jAh8/RKL8lp7P1zK2S5V2dp1jAWIymIYdDBfePhsmwK
-X4C5DreYpK60Stpxjo+xwu5m84vNQCsCSBKZ1mpsZLh04uWjQxBlu/0eYwPxewT5
-xpqD4nWrv4R3jyzzUIi2+qZuIPt4z+6CfeDvMgjO9Da0waV/bXgw/FMFinYLtRBI
-YaI4iVdaW1H+MsDoeb8ww+pWFE62IrXNRjtLjMTH5wKtpf+ugccZrfnnEpJFcy24
-I7JB1IhJpO5fa3suHLfv
-=k0mL
------END PGP SIGNATURE-----
DELETED tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl
Index: tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl
+++ tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl
@@ -1,69 +0,0 @@
-###############################################################################
-#
-# 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 {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
DELETED tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl.asc
Index: tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl.asc
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl.asc
+++ tcl/8.4/win32-x86/Garuda1.0/Scripts/ex_winForms.tcl.asc
@@ -1,18 +0,0 @@
------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-----
DELETED tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl
Index: tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl
+++ tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl
@@ -1,809 +0,0 @@
-###############################################################################
-#
-# 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: $
-#
-###############################################################################
-
-if {![package vsatisfies [package provide Tcl] 8.4]} then {
- error "need Tcl 8.4 or higher"
-}
-
-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:
-
- #
- # 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.
- # "\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
- }
-}
DELETED tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl.asc
Index: tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl.asc
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl.asc
+++ tcl/8.4/win32-x86/Garuda1.0/Tests/all.tcl.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJYHkfCAAoJEFAslq9JXcLZmJMP/3QXndKpA/lBhAWC77PCemDo
-2JMrmXTe5WjuIkK5CFb4b6Vb8ULpqX1aRzgs4WuBCxIgyyU6v0XOHoRbaXPpobXn
-ZUquU/+y+fYlhSxWaCmq0es6RM5Zuu8t6hHvBPFc1dHN+1LjFAivKEVl/aZgGnsU
-QDeUCdvTtL1AQPdiHmlQSp35j/sN01/7Rl6ANUw4VtDEqm+qfYAo5BDhGO+M2RV1
-awcYI1cHkEK565d2GcBJQt7z2dAJiJ2u5zJ4LyBaaaBpppFaQwj2neGA/z00km0c
-4bcKtyAQNFKV0gDoE9FH0GUN13WZGsj0sKs63cXXcbpYbJM1PlAYvZAPG5xAGQxN
-2VRfEDbtNkilHawFfUQMP5lNLBm0gpc/l3BLtkZgMMx9HN71mdFKEj9MT9ia3e0t
-PgVPHvt6vXBBojmn7aBKF/+1g3nREP1Nr16rAynooer1S+bFjmjfyAT3eNIMyg7B
-z285/pixIyVJf8NqX3bEGMGzO3kd2JmU+aU14hI9nF5Mf8vF1UBevvLPhTLHvrCM
-S1uaWQ+OXEBS0yfgvf1jn2j/I1wftRf9PxkIrSw2DbCjyRwRHFwGRrekh2K8EAlu
-ua7MWnqXIm0iuynKSpQqHnk8OiCaqTBYASAGPTvr/sm22SpXSznwmcCSwYhB4Ff+
-CbvkZLKRcFTNfgLA1E3h
-=s7yt
------END PGP SIGNATURE-----
DELETED tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl
Index: tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl
+++ tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl
@@ -1,98 +0,0 @@
-###############################################################################
-#
-# 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: $
-#
-###############################################################################
-
-if {![package vsatisfies [package provide Tcl] 8.4]} then {
- error "need Tcl 8.4 or higher"
-}
-
-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]]
-}
DELETED tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl.asc
Index: tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl.asc
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl.asc
+++ tcl/8.4/win32-x86/Garuda1.0/dotnet.tcl.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJYHkfUAAoJEFAslq9JXcLZ804QAL06jaQ3FBEYEupItJeRolHz
-0s4QHRueoru4DUMLoSwCEsJE3SphtKaQBI9Sp0THguDeLEx0hKYQ82tjDbntMgIy
-cDs3KOpRwMs0TKNcbQWbu8VAPrUyYnoAbAwgEBsbY4JjOlZf/ooZC2WMFe0PoC/d
-A+hIAXVx/xAKxQ9Tpg73AdUJB4WX9uvy+85RDzQnh8axWNfUWJ7TzevoaEuVnlDW
-fZ3ijY5xp1iFmmY9NJYvH5TcYpsRxzags5J8lSHT6jK+v4LghH8LCKnax5JGYAU3
-JqZFGK/ktZZDAKzGxJMRE1FNkP1ZKkB1lMBSE85mQAmX2sUIohMDzA1t0CgTv94E
-Ae0A7aA6NKwVQqIZulJUimY6ldmRpOuJEgg0wIMID7RmpZJHw8/JTCANh46unCyO
-L1esx40BmKf4KEHgG/BF5L81e3E2n7GbT/e7m3BgwrjpHcg36lILl7/XKkKE9p1N
-bFSShsr3ms2j6BVRpmqydRCGOPof2DW3Su3K5mATePaF/AUII5hWE5hzYe5vKgpA
-EB/vriJtckgVmayWI2aKK45H9R70WTNzWs8FJyl2dZ9OpZp/0nYGRzXPvwktQPgJ
-XMAV+C4nDkpYRWhvnRc43SzsdMEDTOukK0/K47scMvHfO8TDyvy1h7aGcO73gfuu
-nP0gAzTO2UyCNAsxiBHS
-=WoFZ
------END PGP SIGNATURE-----
DELETED tcl/8.4/win32-x86/Garuda1.0/helper.tcl
Index: tcl/8.4/win32-x86/Garuda1.0/helper.tcl
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/helper.tcl
+++ tcl/8.4/win32-x86/Garuda1.0/helper.tcl
@@ -1,1491 +0,0 @@
-###############################################################################
-#
-# 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: $
-#
-###############################################################################
-
-if {![package vsatisfies [package provide Tcl] 8.4]} then {
- error "need Tcl 8.4 or higher"
-}
-
-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:
-
- #
- # 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
-}
DELETED tcl/8.4/win32-x86/Garuda1.0/helper.tcl.asc
Index: tcl/8.4/win32-x86/Garuda1.0/helper.tcl.asc
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/helper.tcl.asc
+++ tcl/8.4/win32-x86/Garuda1.0/helper.tcl.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJYHkfJAAoJEFAslq9JXcLZyTUQAMV0hWZy/I+Va3JUtRFRXA8I
-k4mdkoUf4rP3XH6pj0dLaa7dFMxtc+D2v6gMZN6HU+Lm4l05E7f+7Uvew1Y1kGOO
-Aya5Rt8YIcPY29VlNA/q+e++JTWBPR5kAHZ7AwxjAfOL1zI8fEX3GIcfofFLrC2Z
-llpFcQy5nu7PhZgFygUwa+BYNA69fFl7snbMcsI9DLfR/eGqGu2nCq4TPdYgJ8Vc
-RKbOUa4Rj8VtNi3Gb5+eLSBddHdl6l+qB3gMyQjl5khhONlMYoAhY2VgSFCu7zbH
-pHrwPuzALwwpSNzQRUEwDz9xZI+vHt3eAONfMj1uqKkyU7RZdp9U6/q+jj5Db9vA
-t8TnR2JuGYcHqJ0RaMSC2EzecFx5I2wXmWecwDHagL5TCaKI+KRgjUNgGCWuPrNk
-UrBMSfJWncJGVt1DhytoczupumsY/91v+8HI7B9usv8yBE+xp1c6WIYbNTq4qeLK
-dB55TZ5jYXnIQYDEdTLWk7G01EVybKOQSY1tCQK9xCA1PTAv6f7gTGkX68+QtkT0
-6/P4sszZRlWi/+OI7uNJ6bfZnlrFjgrFLjihL1DzAEzg2vaFLteJI7TzeRExsSjs
-0Hd1mnlKBhaptefvj8TXZB5JSM+tc3gv6mrAIOmKJxtzy3btlYInI4aTVFIVtHw7
-XBk7c+Bg9lILOKTThOrN
-=P/A1
------END PGP SIGNATURE-----
DELETED tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll
Index: tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll
+++ tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll
cannot compute difference between binary files
DELETED tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll.asc
Index: tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll.asc
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll.asc
+++ tcl/8.4/win32-x86/Garuda1.0/msvcr100.dll.asc
@@ -1,18 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-Comment: Eagle Package Repository
-
-iQIcBAABCAAGBQJYAbNqAAoJEFAslq9JXcLZ0oIQAIq1bal4dfgFgwHEC3W/Zw+Y
-C1+OkubOZYhQhOyup6ypJmxwdKtjuFkrKwV+1ykQTaZHUO9v7n6kdQ6bZ+rY7o5M
-nF37AjyhATkA95NKkDYP/HZAOVNkNCVWR+eRKOH0PeQb8Qb4pJEvviKMwRA5O5wz
-JSs8E9zQSIqPbdZlmPZrZri8kIZx4AwymSpR+a8rEwfdPtnDMpcUAmMnyDRy2JI4
-y8pDlgCrQnDNn6Iq7Dn5V0IMGZm1fljVKIF80BIaW2CWf+f/TYdkFJEY08Ttev7l
-16GQr7cYS7xM9PKgSfHPsMfrlJ8HuWhBh801MJDM1ounihKgas8y6GQrpokFNFsb
-Gzq9mQ1b3td4CEJw5MClzN2EgWe1hF3dx+kdR9aEOPMEakpaoyyTAmzSV+f5FJem
-+4I6JlMUO5SlxCdC+FjMEV1ISlSmX91AwDMOSSEhZId7D5y4IXxHZVuyML9JjMNg
-KKYZdII1MsdDowemzLWT+gVIDhvPQVe0b4E2PKlIwM+rk9RceKufq4fNx/ThnA4k
-d2LmEryioi01yivzUMpYJx9wQE5TzHNGgiJMFywsCuiPimztwuCZtaw3zGadPXy9
-vZ+yKiNg37JqOJbNxNG7Zuag10/xqxNZLkCZ3TpGgg2tn+igM2jQ48SXxiFPMNKg
-MTUxCCWawS3oUa8iBH4d
-=VfUA
------END PGP SIGNATURE-----
DELETED tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl
Index: tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl
+++ tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl
@@ -1,24 +0,0 @@
-###############################################################################
-#
-# 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]]
DELETED tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl.asc
Index: tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl.asc
==================================================================
--- tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl.asc
+++ tcl/8.4/win32-x86/Garuda1.0/pkgIndex.tcl.asc
@@ -1,18 +0,0 @@
------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-----