ADDED client/1.0/pkgIndex.eagle.asc Index: client/1.0/pkgIndex.eagle.asc ================================================================== --- client/1.0/pkgIndex.eagle.asc +++ client/1.0/pkgIndex.eagle.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 +Comment: Eagle Package Repository + +iQIcBAABCAAGBQJXt2XQAAoJEFAslq9JXcLZ32EQAMPPN6pbNpqtm3OPnEtle0i2 +xXP/0oX1VmdHLpLMDO+DwvlIw4eLB6vDZs2Zmje3t+WxcJPlH2QWgjI4UDmmWS7h +HOt4/EUftPgjKWKUYPNpCj0S1vpVnLv19GWiDp++uYAA+YrdxTu+szeeI/rVaS3k +8dmVdAB7vO+EexhTywB883be5OWNBg1Jr+X7r/362CmXcL0Tdq31VDEP+q6JYTvW +PLM5kf4YMvFREtINhG2eg1s8BZts5Vz4b1NzVmMF9yyngu1pVQ+jkPAgM2A1OM6x +YQTMDTGZlanDDC+l131ts2GE4Lx96PwJBqbPii8Jhbkl+BqBZudDZ+mKhNhehBk5 +nlOJAsKNUNdV+9Zj94AsnqXjNymvocx2n1jI0xJl1mipqJ5S1Awh9s8WyYeXINp0 +WPxyQcamlLOnRz12tic3ht/07kwXjmZXNmy6wfVWX0FyljBhSiOmSxw8z77nLmy+ +hwHB9534Wlg4pEP8x+7N4NP0vu+cyfX9p1DHvNjklpcQLlHxGWAeu8vl87w+uamR +XcJpOnTxLshoVKI6CQunn0/OXAWDk3gi4MuU9+ZtytNfOMErNl85kuFtJLTzP5+H +2p8yGAliXQKET6+1a35u6xiPmjpfa3MABaQH5ooRMPm8Ii9t5pe3Ay3ylq4yB+Zn +IF7GNZh4xmipcTCy/skB +=suyk +-----END PGP SIGNATURE----- ADDED client/1.0/pkgIndex.eagle.harpy.asc Index: client/1.0/pkgIndex.eagle.harpy.asc ================================================================== --- client/1.0/pkgIndex.eagle.harpy.asc +++ client/1.0/pkgIndex.eagle.harpy.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 +Comment: Eagle Package Repository + +iQIcBAABCAAGBQJXt2XQAAoJEFAslq9JXcLZkr0QAJOF2Iv/YTqTtW1kPIOkADx1 +z53Py+zRy/+lfzKio1BQwvcwl/dq8n2i8mbDbYbdFQdkf/H4fqxanALhhGYVpXca +/ZcMSQ/5lT8jXGvcFvT9AXX+/6tiCg6OtoZbNJaODmGW5HqMLEjD66ACvBiPA3lM +T8+IWRcENkE4SQge+mJJ8N9tItIwzW5elvM42qWyh+72qm1lzbwATw9WYXFcJ5mm +KT/ZePRaTRf6O41tJdgn2iMoLys7ypKRNb7VXzrp7r3b5wO9uG3X871yoSBq65BC +ShOh8IeSQQihtogDZOWDIrTlxc4mLNNWl6u7dG4OEvE7wsEsierSOBpT3DZK2gF9 +Fk8R7SQcarbyIYwBkJR35Euywut2iIrHiRa8M2GdfqDibOOCcWpdNYNFMtfeM04r +r27kewNWMhQqv/cK5JPcVQOglkPtVCupA/KH/IhfnPPhoYZPI1oVGVEGtfu2n9Jm +tP03xpgqNNJRc71m3NhRHUgXSahjktEA26GGzdjaIOaRcBinO93VC97IXNJ2BmmX +d7OpDUvQ5qhjGtEw7Ns5d1cifJkvZ0mVQi1OWpGB6dznFr+6NFCgABdNYZ7mTzft +8pL5Rjylbc4Z1X3drbKAGH178EHZ+1FY0CMj4+qWQwV6AMx+0Uq/S+SCGvnMSkIJ +rHorH7mDgTZ9yhTMT7fj +=U5Vk +-----END PGP SIGNATURE----- ADDED client/1.0/pkgIndex.tcl.asc Index: client/1.0/pkgIndex.tcl.asc ================================================================== --- client/1.0/pkgIndex.tcl.asc +++ client/1.0/pkgIndex.tcl.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 +Comment: Eagle Package Repository + +iQIcBAABCAAGBQJXt2XQAAoJEFAslq9JXcLZrdcP/joLk0SYgo+rOoLeqzvneJdS +3m4wOn6Dr6xzfT3d9Hmh/U5GeAabG6nGXroqHlF6RCXDlw2MuzxjwyEYn1ZxXQpT +++gzlxaBtJpo7D6j9CbWtghvDkFQyW+5ucruCFKH2rYr/U5akWiAHke4txFeXJMp +C6zFY0paMD39f0Si/prqwK07MdxtiUCM5wNNs2/hl0sbckV4Blit+BhShi1H74My +NPr4k0GmOSAo1QyYmBb6D0ciCkl6AmbCtj6KQuPXzkhPu0rh0eduxAjcImu70jSu +peQ692PVYUV3vtHd5UVyZFKZeWGWUs27n4oIq/WNv60AocaS09QRikVNvf7kyHDy ++zEXF+yjnFnSdpHplVyfwMQdLz9LCjlqUivYq35Ir6n/C9tMLfqiZChUhyHX9hmB +rnyokRFh45mcF8gJLKC/4D/PKDDjBKyjHdbKLQrJ4bH3y7FSUzOvb3iI8K4/Omyt +uS18QYYtlovub0Bkc26TCVqlsytuv9Zc3Y6P8YlrLV7+lxGQs3hhgK6X0xK4GU6h +5aNE964elyYapPC3ToVEqvZaQsDM9vs1avW8SxcCvudixnzAycslcysv8JVaZXnG +u6WPT/zxt65BF+gXOBm5qpeFEQIn34WZdTHqXMgmUslT+uJ7y3cRXIKWGkzkebHZ +1PissA/AN1MgUYPp69ZV +=BbsA +-----END PGP SIGNATURE----- ADDED client/1.0/pkgIndex.tcl.harpy.asc Index: client/1.0/pkgIndex.tcl.harpy.asc ================================================================== --- client/1.0/pkgIndex.tcl.harpy.asc +++ client/1.0/pkgIndex.tcl.harpy.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 +Comment: Eagle Package Repository + +iQIcBAABCAAGBQJXt2XQAAoJEFAslq9JXcLZ2A0P/jA5sVS+kH4CvEQHGdNK5UXH +oU7RP5zdJtYf/q/02JRWPRAJ4BZfT3jqreN8GU5Bpf1B1Bd3kQRFqMBPRIW1D9ir +3OpnTpO0t7l2nG/CR7fZu/a8IKSoTUqV+tsRaENAV4cGqKQw5wIwbuOuqR5WwAdT +M7VeQwDPNmnS9/GJr7SNGND31qUCgvWis8wEI5D9J/d4lLVuQkTRRhg4Vuw0BAza +Cr5ot49aZp7BaPSrnpv5hMpf5zrw71FZDmuQ9iW69+JfvIw6zwFCORM27RbY2ZQc +25pEeQABkAUwncjoUla0eGV1d/uRQu+Eo7MZMHu7l1ERdCmUGvwJBJLoAuqxfLCq +lx5TIaUBqHVSR+3q6mHXaYmUQN54qImTKsrko80futBhVCruFu8mkjg0QHi9rMBC +rF8gLm7cbv/9Bxfv/pP10bFBRps0YrwBE5oH9A2mEspVzoL1SzmhjyNleIJmY/eG +P4tzU06L8K4dYj4sQzF4Y+pdlqaBDzbR4Rffc8pVOw1Qj0abMmAGSkwsLHd5qqmg +AalvvZoNwncrYURAtdDfkhb4YPF3ENG+8GHRU1eKlpaiLXRJ7Qwr9qsr7gMtYEjC +oz5YHO8W1txL6Ko9TDt7iAiik7anNcMlXg1AcNpBwoKlPHliLig1dHwN9es+3QHP +mum3qexuHOGUJSEZa9di +=YwgS +-----END PGP SIGNATURE----- Index: client/1.0/pkgd.eagle ================================================================== --- client/1.0/pkgd.eagle +++ client/1.0/pkgd.eagle @@ -23,11 +23,21 @@ # # NOTE: This procedure sets up the default values for all configuration # parameters used by the package downloader client. There are no # arguments. # - proc setupDownloadVars {} { + proc setupDownloadVars { script } { + # + # NOTE: What is the fully qualified path to the directory containing the + # package downloader client? + # + variable clientDirectory + + if {![info exists clientDirectory]} then { + set clientDirectory [file dirname $script] + } + # # NOTE: Prevent progress messages from being displayed while downloading # from the repository, etc? By default, this is enabled. # variable quiet; # DEFAULT: true @@ -56,14 +66,24 @@ } # # NOTE: The root directory where any persistent packages will be saved. # - variable persistentDirectory; # DEFAULT: [getPersistentRootDirectory] + variable persistentRootDirectory; # DEFAULT: [getPersistentRootDirectory] + + if {![info exists persistentRootDirectory]} then { + set persistentRootDirectory [getPersistentRootDirectory] + } + + # + # NOTE: The root directory where any temporary packages will be written. + # + variable temporaryRootDirectory; # DEFAULT: [getFileTempDirectory PKGD_TEMP] - if {![info exists persistentDirectory]} then { - set persistentDirectory [getPersistentRootDirectory] + if {![info exists temporaryRootDirectory]} then { + set temporaryRootDirectory \ + [::PackageRepository::getFileTempDirectory PKGD_TEMP] } } # # NOTE: This procedure returns the root directory where any packages that @@ -75,10 +95,58 @@ # NOTE: Return a directory parallel to the one containing the library # directory. # return [file join [file dirname [info library]] pkgd] } + + # + # NOTE: This procedure returns non-zero if the specified file seems to be + # an OpenPGP signature file. The fileName argument is the name of + # the file to check, which may or may not exist. The nameOnly + # argument should be non-zero to ignore the contents of the file. + # + proc isPgpSignatureFileName { fileName nameOnly } { + if {[string length $fileName] == 0} then { + return false + } + + set extension [file extension $fileName] + + if {$extension eq ".asc"} then { + if {!$nameOnly && [file exists $fileName]} then { + return [::PackageRepository::isPgpSignature [readFile $fileName]] + } else { + return true + } + } else { + return false + } + } + + # + # NOTE: This procedure returns non-zero if the specified file seems to be + # a Harpy script certificate file. The fileName argument is the name + # of the file to check, which may or may not exist. The nameOnly + # argument should be non-zero to ignore the contents of the file. + # + proc isHarpyCertificateFileName { fileName nameOnly } { + if {[string length $fileName] == 0} then { + return false + } + + set extension [file extension $fileName] + + if {$extension eq ".harpy"} then { + if {!$nameOnly && [file exists $fileName]} then { + return [::PackageRepository::isHarpyCertificate [readFile $fileName]] + } else { + return true + } + } else { + return false + } + } # # NOTE: This procedure adds a directory to the auto-path of the specified # language (i.e. native Tcl or Eagle). The directory will not be # added if it is already present. The language argument must be the @@ -125,71 +193,122 @@ } else { error "unsupported language, no idea how to modify auto-path" } } + # + # NOTE: This procedure downloads a single file from the package file server, + # writing its contents to the specified local file name. It can also + # verify the OpenPGP signatures. When an OpenPGP signature file is + # downloaded, this procedure assumes the corresponding data file was + # already downloaded (i.e. since OpenPGP needs both to perform the + # signature checks). The language argument must be one of the + # literal strings "eagle", "tcl", or "client". The version argument + # must be one of the literal strings "8.4", "8.5", or "8.6" when the + # language is "tcl" -OR- the literal string "1.0" when the language + # is either "eagle" or "client". The fileName argument is a file + # name relative to the language and version-specific directory on the + # package file server. The localFileName argument is the file name + # where the downloaded file should be written. The usePgp argument + # should be non-zero when an OpenPGP signature file needs to be + # downloaded and verified for the downloaded file. + # + proc downloadOneFile { language version fileName localFileName usePgp } { + variable baseUri + variable downloadUri + variable quiet + + # + # NOTE: First, build the full relative file name to download from + # the remote package repository. + # + set fileName [file join $language $version $fileName] + 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. + # + if {[isEagle]} then { + writeFile $localFileName [interp readorgetscriptfile -- "" $uri] + } else { + writeFile $localFileName \ + [::PackageRepository::getFileViaHttp $uri 10 stdout $quiet] + } + + # + # NOTE: Is use of OpenPGP for signature verification enabled? Also, + # did we just download an OpenPGP signature file? + # + if {$usePgp && [isPgpSignatureFileName $localFileName true]} then { + # + # NOTE: Attempt to verify the OpenPGP signature. If this fails, + # an error is raised. + # + if {![::PackageRepository::verifyPgpSignature $localFileName]} then { + error [appendArgs \ + "bad PGP signature \"" $localFileName \"] + } + } + } + # # NOTE: This procedure attempts to download a list of files, optionally # persistening them for subsequent uses by the target language. - # The language argument must be the literal string "eagle" or the - # literal string "tcl". The version argument must be the literal - # string "8.4", "8.5", or "8.6" when the language is "tcl" -OR- - # the literal string "1.0" when the language is "eagle". The - # fileNames argument must be a well-formed list of file names to - # download, each one relative to the language/version-specific - # directory on the package file server. The persistent argument - # should be non-zero if the downloaded files should be saved to - # permanent storage for subsequent use. The usePgp argument - # should be non-zero when an OpenPGP signature file needs to be - # downloaded and verified for each downloaded file. The + # The language argument must be one of the literal strings "eagle", + # "tcl", or "client". The version argument must be one of the + # literal strings "8.4", "8.5", or "8.6" when the language is "tcl" + # -OR- the literal string "1.0" when the language is either "eagle" + # or "client". The fileNames argument must be a well-formed list + # of file names to download, each one relative to the language and + # version-specific directory on the package file server. The + # persistent argument should be non-zero if the downloaded files + # should be saved to permanent storage for subsequent use. The + # usePgp argument should be non-zero when an OpenPGP signature file + # needs to be downloaded and verified for each downloaded file. The # useAutoPath argument should be non-zero to modify the auto-path # to include the temporary or persistent directories containing # the downloaded files. # # proc downloadFiles { language version fileNames persistent usePgp useAutoPath } { - variable baseUri - variable downloadUri - variable persistentDirectory - variable quiet + variable clientDirectory + variable persistentRootDirectory + variable temporaryRootDirectory + + set client false if {[string length $language] == 0 || $language eq "eagle"} then { if {$version ne "1.0"} then { error "unsupported Eagle version" } } elseif {$language eq "tcl"} then { if {$version ne "8.4" && $version ne "8.5" && $version ne "8.6"} then { error "unsupported Tcl version" } + } elseif {$language eq "client"} then { + if {$version ne "1.0"} then { + error "unsupported client version" + } + + set client true } else { error "unsupported language" } - if {$persistent} then { - set downloadRootDirectory $persistentDirectory - } else { - set directoryNameOnly [appendArgs \ - pkgd_ [string trim [pid] -] _ [string trim [clock seconds] -]] - - global env - - if {[info exists env(PKGD_TEMP)]} then { - set downloadRootDirectory $env(PKGD_TEMP) - } elseif {[info exists env(TEMP)]} then { - set downloadRootDirectory $env(TEMP) - } elseif {[info exists env(TMP)]} then { - set downloadRootDirectory $env(TMP) - } else { - error "please set PKGD_TEMP (via environment) to temporary directory" - } - - set downloadRootDirectory [file join \ - $downloadRootDirectory $directoryNameOnly] - } - - set downloadDirectories [list] + set temporaryDirectory [file join $temporaryRootDirectory \ + [appendArgs pkgd_ [string trim [pid] -] _ [string trim \ + [clock seconds] -]]] + + if {$client} then { + set persistentDirectory $clientDirectory + } else { + set persistentDirectory $persistentRootDirectory + } + + set downloadedFileNames [list] foreach fileName $fileNames { if {[string length $fileName] == 0 || \ [file pathtype $fileName] ne "relative"} then { error [appendArgs \ @@ -201,61 +320,69 @@ if {[llength $directoryParts] == 0} then { error [appendArgs \ "bad file name \"" $fileName "\", no directory parts"] } - set downloadDirectory [file normalize [eval file join \ - [list $downloadRootDirectory] $directoryParts]] + set directory(temporary) [file normalize [eval \ + file join [list $temporaryDirectory] $directoryParts]] + + set directory(persistent) [file normalize [eval \ + file join [list $persistentDirectory] $directoryParts]] + + set fileNameOnly [file tail $fileName] set downloadFileName [file normalize [file join \ - $downloadDirectory [file tail $fileName]]] + $directory(temporary) $fileNameOnly]] - if {!$persistent} then { - catch {file delete $downloadFileName} + if {[file exists $downloadFileName]} then { + error [appendArgs \ + "temporary file name \"" $downloadFileName \ + "\" already exists"] } file mkdir [file dirname $downloadFileName] - - set savedFileName $fileName - set fileName [file join $language $version $fileName] - set uri [subst $downloadUri] - set fileName $savedFileName - - if {[isEagle]} then { - writeFile $downloadFileName \ - [interp readorgetscriptfile -- "" $uri] - } else { - writeFile $downloadFileName \ - [::PackageRepository::getFileViaHttp $uri 10 stdout $quiet] - } - - if {$usePgp} then { - set downloadSignatureFileName [appendArgs $downloadFileName .asc] - - set savedFileName $fileName - set fileName [file join \ - $language $version [appendArgs $fileName .asc]] - - set uri [subst $downloadUri] - set fileName $savedFileName - - if {[isEagle]} then { - writeFile $downloadSignatureFileName \ - [interp readorgetscriptfile -- "" $uri] - } else { - writeFile $downloadSignatureFileName \ - [::PackageRepository::getFileViaHttp $uri 10 stdout $quiet] - } - - if {![::PackageRepository::verifyPgpSignature \ - $downloadSignatureFileName]} then { - error [appendArgs \ - "bad PGP signature \"" $downloadSignatureFileName \"] - } - } - - lappend downloadDirectories $downloadDirectory + downloadOneFile $language $version $fileName $downloadFileName $usePgp + + lappend downloadedFileNames [list \ + $fileNameOnly $directory(temporary) $directory(persistent)] + + if {$usePgp && ![isPgpSignatureFileName $downloadFileName true]} then { + downloadOneFile $language $version [appendArgs $fileName .asc] \ + [appendArgs $downloadFileName .asc] $usePgp + + lappend downloadedFileNames [list \ + [appendArgs $fileNameOnly .asc] $directory(temporary) \ + $directory(persistent)] + } + } + + set downloadDirectories [list] + + foreach downloadedFileName $downloadedFileNames { + set directory(temporary) [lindex $downloadedFileName 1] + + if {$persistent} then { + set fileNameOnly [lindex $downloadedFileName 0] + set directory(persistent) [lindex $downloadedFileName 2] + + file mkdir $directory(persistent) + set command [list file copy] + + if {$client} then { + lappend command -force + } + + lappend command -- + lappend command [file join $directory(temporary) $fileNameOnly] + lappend command [file join $directory(persistent) $fileNameOnly] + + eval $command + + lappend downloadDirectories $directory(persistent) + } else { + lappend downloadDirectories $directory(temporary) + } } set downloadDirectories [lsort -unique $downloadDirectories] if {$useAutoPath} then { @@ -279,13 +406,13 @@ ::PackageRepository::maybeReadSettingsFile [info script] # # NOTE: Setup the variables, within this namespace, used by this script. # - setupDownloadVars + setupDownloadVars [info script] # # NOTE: Provide the package to the interpreter. # package provide Eagle.Package.Downloader \ [expr {[isEagle] ? [info engine PatchLevel] : "1.0"}] } ADDED client/1.0/pkgd.eagle.asc Index: client/1.0/pkgd.eagle.asc ================================================================== --- client/1.0/pkgd.eagle.asc +++ client/1.0/pkgd.eagle.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 +Comment: Eagle Package Repository + +iQIcBAABCAAGBQJXt2XPAAoJEFAslq9JXcLZ1CEP/0B1UJTavhqz6czrPC/IH1vi +jBQ2GyZXuvxTi0VbasUxqfKSScy6HzNMAqSX9f3rdQRNFDgS2ynU3KHT757GOfjA +h09kAA9gwd8oAbKkVmtARpKIiHqNn6yiK4LPxpjPau3caS/9vyzaOVoqcTmfPPS3 +W7AXqxkbzbYQjkWk06AnstPPDez9ZQ0ZP8ngsccN++AJyYr1XIiyfkgx4TR8ZEWL +UwP0Q/rRWeg+KcJokrpbXJyYe2U2/aYjuQwgdTGugDmNQTCghwiIhc9LgVK0OJ83 +ez1X1PegQ65RjKD6Q8Hm4WAfiv47Le9KqtSzs0AfjKNESIQm0LP5BY1IN2ukaHjc +k/v7S7kVOFMCq/J+bBAQOmkLHAapLVQiZr5TjRSRKJ5KCos76TqiQVOV/T58cdiy +YozVFjFKwmRJPgdgAChjBQ6JXg9/XG8Nec253gMJdd4xUKOqNocDpAlBW49Efz2w +zUqQMyianb1W8rnnSrSM5KImui+q+RgDmwiL/RtfUFgtnndUdsGTVcngA8ORhJfB +x3ZhOrknny/A9YDXF8SdZoZb766tUkVDwWR7pCAqwAimSJsasTNsEgwPaWAJhoHk +U+cqUOagoK5UsxlRqyUmdEo+Iz00OTrBMIkbhhpxcCwNeJgnOKgMhXC8ThFWBc02 +3r99h0tvCs0wjrlvKviz +=Qmu6 +-----END PGP SIGNATURE----- Index: client/1.0/pkgd.eagle.harpy ================================================================== --- client/1.0/pkgd.eagle.harpy +++ client/1.0/pkgd.eagle.harpy @@ -19,32 +19,32 @@ None Mistachkin Systems - 53a7ee35-d269-407b-9849-062af5a64876 + 35699df9-d62a-40d3-80c9-7605014c9539 SHA512 Script - 2016-08-19T02:47:10.2744609Z + 2016-08-19T19:59:41.5664531Z -1.00:00:00 0x2c322765603b5278 - Yp/5NPzblsNKAItBjTMKYni6R3tyMPN2ZEGrwDcSZNi4/Y1QlXWD9BF/MdF0Glc93u7UpJw3Itwt - dYziRGX2yMsaddIx7gUawg5L7vc1eCz0BTohnSctzR1wU8My0BV5wCqDvAgJICtHWJM53H6XTLW3 - CgtsZjXN0GRbDVEos3D77uK1BmPdSWLyi2L0SMA/QiGtlVY1lnP5/X6hpvBfbEX0YmDK45mEO1VR - lh2Y+aN+Jf05jiKjJwdOR4ZK1wDuW313FByM9FgDlRDpCXlnZfAeSnTPmCIafwOILlK3EZdHDJCy - 0gvFySMslL0m177+Sfpr7QW0F1ZZ4ENlse5i3ac33sF6RkAVvkmP9ZbjEq+N8+2G4v68+Yed7dET - 5Rwo//rU4QJE+To2oqJJpgv1ZsWcdqASUuof3o73gn8fRCZo95ctYvQHURzK7mFT/tTndsl/nlUq - PFeoltj0amd3sI86eHRR99rybruihdt6rETXCbhnh7+nJF6YL9SD73TX5O0+RBzOTRxkYKvdgGyX - pJ83iJtZC5N6SEySjiZlTAaLe4YTuJyaIkYDn/HWKMme7k8A7gK/Ig2iPTRUJiXm31hIn6VLfJXt - XFgoW9Ln0PAZlm4tNbeJraEeArU3YJ3vQ2FzNT7QgU1ruNiHbObOGhs76/a1XOSaoAXBRR8PgUIF - l+GWC77nJVGGeFwdUsDaJf6seEfnEV1Srp2mMFKT3Zo34Z3PMOZr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VxEwfUjE/cuxp2wl+gi9 + /azadXRGoRRiMwHaQ8GUI6rfpyzbc7YwVJJuTm14H1dN41s5G9lzNAH6uCaYwp8xC1GYNz/Rbg7H + /0yfZZQMnx5uzK/CDksdGXymC4Ta0KxEV/edLy/cUhozyOWckW0tk+KcPmj/iuvOtwHEhS/yUF+C + j+bIU0/qZks6EkoZjLG+Xj1LfGQd2C/HMMvGk/tF3/+zyl5LkpRPpYA3smCF2qrUPsJJvxgNPgVc + ZhyBHWq61GPY/C81HE7K3DY7j5m6Z2qehh1hP49KYbB9+RhzBwluah0YdQqN+2/22nDsyvZZFeWI + LBnUGJ7jwi+aUYWNAMxJ7G12GQNXMhkH0F8KISl0iYfSBzEPUYZ1FA/ZlI2DDdJpGaiESc0KMHgJ + m6s9Uf5SZ4xVxJ7NZ/DZ7rasuJoqDWkmrnIYbxHJoFbIWS9cWKVgqHVUEjNq8A/sCTAZGT/0Ba4S + HGX/EWhlh8pfsQleny5wKBHXMqZeQj5ELAjSsvrLM3yw9G/Y4FWBnA4T7VsoVsjHFMc0gvaDNB0b + 2NTgi92M+Z8Y7dg1GgieEi7vPwweHYDW/7myQ/q33XREEGJrc6qH0dHNvJ3bE30Gy3ioawLMVvWX + MCkiogdtbbBS6vtuE8u27CARIz1PIUot01S9gTItpHfKnKJoSda0RdvUBVIoRSjGO97ikQEzeXZx + DbGyaD2BHwJuT7MGa0lNJBavXx/sFj69tDCls5fl+RsBJ6DQbcXY7ZUA0zPHAb1icocykucYBvKV + 8Zfn7MLRO7Zq/xVZpjlEN1VsPx8OP1SDoB/Tyg8U6uHOxE2WL3/ZnunVi0UDmSu9ZWlRc3bplPCB + 4tRCB9dBinUgBT1EtDYE8kI8ChrpjunmHVhWCtgpJjFlzTAlb43VzA4az+nA6tPTOxIavjDqnw== ADDED client/1.0/pkgd.eagle.harpy.asc Index: client/1.0/pkgd.eagle.harpy.asc ================================================================== --- client/1.0/pkgd.eagle.harpy.asc +++ client/1.0/pkgd.eagle.harpy.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 +Comment: Eagle Package Repository + +iQIcBAABCAAGBQJXt2XPAAoJEFAslq9JXcLZowIQAKbwbYM0Zr3EOdHEJuyIw9dH +0Vd6rFguJfZb0zFjOY3IC0WPP9CSmo+l5p0ZiN3wM6qNdPLcgitKESheqgLuAQMp +8l7Wz3J+xuxFFxcElHiBmSkTVn28QOjxHi0/n8iMlKAuWDrWopJ6mPI7cmwTcO/4 +ufQT6m1B49Rjfx5j7SkJHd0kdny5j58uMEdOt8UeBU6mWdQpI6m2JFjOYbORrQFK +GwsLd9uwF9MPtA48rOTkXePGsHxHRu+jPwX7hd2CU2dYtnA09lTH82WLOJDT7L1E +cenrzpZVNU7pRl1Us9muc6btiVDxnHwRxUKI1d6GmhyXRtXYnpGyDYoQpDsz6VT7 +6PPZmAVTYafxJaHg0Ni1J0Dha1bdBgjyGUcschOLdrYlJ8ytX+frAN1Z2/gdb/uF +SW7iqDQVl+SUdGbj8iSjxbQOHE2HMrt7wDq6nxEdPpqyxccaqdkYk4tdXBWPFj7Z +vVZ4ZwHu4HJThR/Zn3XHp2QoLfvyKqRL6krTP7L870LKAjL1aS0nprWuviilbsCP +M2Bvz+AEnSYgkGOmLukVZcTtDdfUBjvn24qiofnfIFD8Zt9oZd50766IKSL1f1oc +HaUV1uHYw6NnYn1eKd8N44TYp7zJONMgBV35oxwXSkthE/mIRKXFThIfvh3gkdFK +DD7LirqtmuD7+dg/CcIy +=R/hw +-----END PGP SIGNATURE----- Index: client/1.0/pkgr.eagle ================================================================== --- client/1.0/pkgr.eagle +++ client/1.0/pkgr.eagle @@ -97,34 +97,58 @@ # looks like a Harpy (script) certificate. The value argument # is the string to check. # # proc isHarpyCertificate { value } { - if {[string length $value] == 0 || [string first [string trim { + if {[string length $value] == 0 || ([string first [string trim { + + }] $value] == 0 && [string first [string trim { proc isPgpSignature { value } { if {[string length $value] == 0 || [string first [string trim { -----BEGIN PGP SIGNATURE----- - }] $value] != -1} then { + }] $value] == 0} then { return true } else { return false } } + + # + # NOTE: This procedure returns the fully qualified name of the directory + # where temporary files should be written. The envVarName argument + # is an optional extra environment variable to check (first). + # + proc getFileTempDirectory { {envVarName ""} } { + global env + + if {[string length $envVarName] > 0 && \ + [info exists env($envVarName)]} then { + return $env($envVarName) + } elseif {[info exists env(TEMP)]} then { + return $env(TEMP) + } elseif {[info exists env(TMP)]} then { + return $env(TMP) + } else { + error [appendArgs \ + "please set " $envVarName \ + " (via environment) to temporary directory"] + } + } # # NOTE: This procedure returns a unique temporary file name. A script # error is raised if this task cannot be accomplished. There are # no arguments. @@ -131,22 +155,11 @@ # proc getFileTempName {} { if {[isEagle]} then { return [file tempname] } else { - global env - - if {[info exists env(PKGR_TEMP)]} then { - set directory $env(PKGD_TEMP) - } elseif {[info exists env(TEMP)]} then { - set directory $env(TEMP) - } elseif {[info exists env(TMP)]} then { - set directory $env(TMP) - } else { - error "please set PKGR_TEMP (via environment) to temporary directory" - } - + set directory [getFileTempDirectory PKGR_TEMP] set counter [expr {[pid] ^ int(rand() * 0xFFFF)}] while {1} { set fileNameOnly [format tcl%04X.tmp $counter] set fileName [file join $directory $fileNameOnly] @@ -159,15 +172,16 @@ } } } # - # NOTE: This procedure attempts to verify the PGP signature contained in - # the specified (named) file. Non-zero is only returned if the PGP - # signature is verified successfully. A script error should not be - # raised by this procedure. The fileName argument must be the fully - # qualified path and file name of the PGP signature file to verify. + # NOTE: This procedure attempts to verify the OpenPGP signature contained + # in the specified (named) file. Non-zero is only returned if the + # OpenPGP signature is verified successfully. A script error should + # not be raised by this procedure. The fileName argument must be + # the fully qualified path and file name of the OpenPGP signature + # file to verify. # # proc verifyPgpSignature { fileName } { variable pgpCommand @@ -632,12 +646,12 @@ } # # NOTE: This procedure uses the package lookup metadata. If the package # script is properly signed, an attempt will be made to evaluate it - # in the target language. If the script was signed using PGP, then - # a conforming implementation of the OpenPGP specification (e.g. + # in the target language. If the script was signed using OpenPGP, + # then a conforming implementation of the OpenPGP specification (e.g. # gpg2) must be installed locally. If the script was signed using # Harpy then Garuda, Eagle, and Harpy must be installed locally. # This procedure is designed to work for both native Tcl and Eagle # packages. Additionally, it is designed to work when evaluated # using either native Tcl or Eagle; however, it is up to the package @@ -894,11 +908,11 @@ # can do here. # if {[string length $metadata(script)] > 0} then { # # NOTE: Figure out temporary file name for the downloaded script - # and its associated PGP signature. + # and its associated OpenPGP signature. # set fileName(1) [getFileTempName] set fileName(2) [appendArgs $fileName(1) .asc] # @@ -905,42 +919,43 @@ # NOTE: Write downloaded script to a temporary file. # writeFile $fileName(1) $metadata(script) # - # NOTE: Write downloaded script PGP signature a temporary file. + # NOTE: Write downloaded script OpenPGP signature a temporary file. # if {[string length $metadata(certificate)] > 0} then { writeFile $fileName(2) $metadata(certificate) } # - # NOTE: Attempt to verify the PGP signature for the package script. + # NOTE: Attempt to verify the OpenPGP signature for the package + # script. # if {[verifyPgpSignature $fileName(2)]} then { # - # NOTE: Delete the temporary files that we created for the PGP - # signature verification. + # NOTE: Delete the temporary files that we created for the + # OpenPGP signature verification. # eval $script(cleanup) } else { # - # NOTE: Delete the temporary files that we created for the PGP - # signature verification. + # NOTE: Delete the temporary files that we created for the + # OpenPGP signature verification. # eval $script(cleanup) # - # NOTE: PGP signature verification failed. Raise an error and - # do not proceed with evaluating the package script. + # NOTE: OpenPGP signature verification failed. Raise an error + # and do not proceed with evaluating the package script. # error "bad PGP signature" } # - # NOTE: The PGP signature was verified; use the downloaded package - # script verbatim. + # NOTE: The OpenPGP signature was verified; use the downloaded + # package script verbatim. # set script(inner) $metadata(script) # # NOTE: Determine the target language for the package script, which ADDED client/1.0/pkgr.eagle.asc Index: client/1.0/pkgr.eagle.asc ================================================================== --- client/1.0/pkgr.eagle.asc +++ client/1.0/pkgr.eagle.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 +Comment: Eagle Package Repository + +iQIcBAABCAAGBQJXt2XQAAoJEFAslq9JXcLZTusP/21Qef38tpDZssTgsC154WPR +zIPz3V9L0Cxex248Seyvm8e5v+jk6bE1axVDgxVwptSBaRr+swzyAVDWvKowYS4F +EcoZDhdeKceYIR9dHpbFvfBisil0SkI1HJQHmh+1+jMme/BKzMua/Az/dcb+GkZH +2T6sL6ytqcZsnh6KgHKxRiOx63FSibZCPLNSFd7FKzEX/udz3xXjcVGdEf/rY1nM +59idq0yygXIXmknGPcBTY+Og5eOZOYlxMlKE0stuv0TuflVz4emXOnbv9Hfb/gkR +SSY4qCI6aapWGgjBFY49nCGFFsA2QZUq4gBm/KC/Kn/TIqkPLnJBngjK4pZwVcBt +LquQmqMe4z06sZ3Ct5NoqNxFmhUouj0WpKn6aOZ52ildz6+MrFqi5QhctGNFkcIc +bc4GOADo4/G68vlPPcl/5+VDqQMQe2dGqxowVALrNCXyKE/rw+xGwpoQcl3B4PEI +iCNX5qMrM+0QzB/dvf4JDfbA9Jo17C9NsTgUTMskK0VIaXgz9Lvg1yUQ8Ai+lTC0 +O/hmtmqrx40yg8iw8P1/1g9u37rrw+J8bKSarL4B9W4O06/Cdln9c7uTJuH+ZMH6 +IEyn8Zz8cnxaHvfYi50qhwV1MgrH6gySE6movIN0+pPVX6VKLBqHzX1KUVS/6+08 +hH0VVJpSVKX6zrGYYsYn +=su6k +-----END PGP SIGNATURE----- Index: client/1.0/pkgr.eagle.harpy ================================================================== --- client/1.0/pkgr.eagle.harpy +++ client/1.0/pkgr.eagle.harpy @@ -19,32 +19,32 @@ None Mistachkin Systems - 88d42a28-1e95-4dd7-aaf9-11bb262f10d0 + b72e4969-c47f-4935-95df-c483ce315d11 SHA512 Script - 2016-08-19T02:47:51.4043437Z + 2016-08-19T19:59:26.5352031Z -1.00:00:00 0x2c322765603b5278 - Mn+rsBh675oM30+X6J/Myzrc0MmxmLCjpzV4bDcl8nZcbdSXszHTHE9ma5tAXopb05bMomy5lHal - CjEGgYubJtQFcQzuKlxp0UMVgMpK28uTS/ik9RSKXwgq83N1p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3WPQdzxjEA+lxDooFamaVMY0fsIpEdnkkIQ + b7lCYQm1zpc4DRJLukyUKgSVlAQhk+o02HD0N9rJyO2v+Wp8xMP6Mqxe5BqYp5uy0oXIOtrm+PyL + 5u0gq76Rf7mhd/5mgFqTwL+I/cYQUCJCv0nz1SDawFDfLdm/QVFh3H11eaff1doCnfMfIrBkhu6E + +FaJLpAade0py0t8yssl2R7PISGWuRBJxlC6fNgVF5jdLkYIVq+osXxbglF0hh/SQb8O09KbgiQ9 + MCBFHWelAmvIo6ulywRbyc5BDeujGUaKyxDlMhVx2Np/8vqs+GILjTBjbHsTpUZbXD9beKGnW7TH + tvwKa+MgoTpLR22xz9P2+k3y0XocnzrRV+5UxMPCMuYCPcqygyvGVt0P3z41Xw8VkAXYfYECOBft + wKKbMbRvJ2N7N2O44bFhlchyG8eVtuoIxxim6bqGLIKSLXmREeYKPkPD7Ux3GEqSTKhzpeu1zw== ADDED client/1.0/pkgr.eagle.harpy.asc Index: client/1.0/pkgr.eagle.harpy.asc ================================================================== --- client/1.0/pkgr.eagle.harpy.asc +++ client/1.0/pkgr.eagle.harpy.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 +Comment: Eagle Package Repository + +iQIcBAABCAAGBQJXt2XQAAoJEFAslq9JXcLZtCUP/3vbRtwDk52ZjEA1ICk9GJ/V +xA/GbkOHDKm7ayXo3DiFiXZX5KvYLBsO2jP8GLqfzt7J4rPvoIvzmXdWIJyBLbFp +LqqivBBK6pXW+BAoBB+Pmv8LjeJqqhIZ9Gx956MIM1AldzYjBvLxyk+631yMQIu6 +AnhCtddyWZNAfTUKL0C2wmUuDph7u1K9xPyDtn4MbW5QPMcz/KHVSKtsfFeFNzCi ++wo++YEA5VZ9F+sJROEKiTrhiCUwka2EdWsxVlkEQYdAwsZypbKFuqWMzuRiH03n +oOdAFGkNA1HeQ4w/+0juFbkRwSOz6JZ8BHPY2hPTr6aD1Uw1DjBlJFTFZUH6QRWm +7jcgoa0+tmWnxhNfq4sqz8UNltcKBMwUSP2L8b0mGA9P2rl/svpnMZK36TSquRNO +2jsjw5IVikeSmFoX2LKK4HRGK3FW8up3NgVvwVIE8nWaAIDrXPI+cMVFVWJnwOgz +13dwBAzSyTCJxP/rzcRAsu8HS+gvILXaqNys7EhphnbbalkELiOOxWfHBZ2FNsCC +ZdqVPUaKIM9LRrAqpdjTFRiUYr1Dxg7HCPGNKR1I1edTQD4QvuYBopxssY2rt1sK +y9ezxku6+nP3U8QWSv9jEPL68gzpWuZaYjg3QB4uutAjMq2q+duOLsL7tLMWTnrP +xMChp973TbAv1N30Y0g1 +=tPeo +-----END PGP SIGNATURE-----