Overview
Comment: | Add support for checking the installed version of a package prior to downloading it. Also, finish removing the fix applied in check-in [345ffb1dd5] (i.e. removal of the 'm' query parameter). |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
8d39ddb985e384f33994a6df51fedfd6 |
User & Date: | mistachkin on 2016-08-19 23:27:02 |
Original Comment: | Add support for checking the installed version of a package prior to downloading it. |
Other Links: | manifest | tags |
Context
2016-08-21
| ||
03:10 | Unify the 'unique suffix' handling used by the client packages. Tighten up temporary directory handling, deleting them when possible. check-in: 0bff0fc24a user: mistachkin tags: trunk | |
2016-08-19
| ||
23:27 | Add support for checking the installed version of a package prior to downloading it. Also, finish removing the fix applied in check-in [345ffb1dd5] (i.e. removal of the 'm' query parameter). check-in: 8d39ddb985 user: mistachkin tags: trunk | |
23:11 | Add VERSION file for the package repository/downloader client. check-in: 465bd53795 user: mistachkin tags: trunk | |
Changes
Modified client/1.0/pkgd.eagle from [a24ae288ef] to [8f95de070a].
︙ | ︙ | |||
55 56 57 58 59 60 61 | set baseUri https://urn.to/r/pkgd } # # NOTE: The URI where a single package file may be found. This file will # belong to a specific version of one package. # | | | | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | set baseUri https://urn.to/r/pkgd } # # NOTE: The URI where a single package file may be found. This file will # belong to a specific version of one package. # variable downloadUri; # DEFAULT: ${baseUri}?...&filename=${fileName} if {![info exists downloadUri]} then { set downloadUri {${baseUri}?download&ci=trunk&filename=${fileName}} } # # NOTE: The root directory where any persistent packages will be saved. # variable persistentRootDirectory; # DEFAULT: [getPersistentRootDirectory] |
︙ | ︙ | |||
80 81 82 83 84 85 86 87 88 89 90 91 92 93 | variable temporaryRootDirectory; # DEFAULT: [getFileTempDirectory PKGD_TEMP] if {![info exists temporaryRootDirectory]} then { set temporaryRootDirectory \ [::PackageRepository::getFileTempDirectory PKGD_TEMP] } } # # NOTE: This procedure returns the root directory where any packages that # are downloaded should be saved to permanent storage for subsequent # use. There are no arguments. # proc getPersistentRootDirectory {} { | > > > > > > > > > > | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | variable temporaryRootDirectory; # DEFAULT: [getFileTempDirectory PKGD_TEMP] if {![info exists temporaryRootDirectory]} then { set temporaryRootDirectory \ [::PackageRepository::getFileTempDirectory PKGD_TEMP] } } # # NOTE: This procedure returns a directory name suffix that is unique to # the running process at the current point in time. There are no # arguments. # proc getUniqueDirectorySuffix {} { return [appendArgs \ [string trim [pid] -] _ [string trim [clock seconds] -]] } # # NOTE: This procedure returns the root directory where any packages that # are downloaded should be saved to permanent storage for subsequent # use. There are no arguments. # proc getPersistentRootDirectory {} { |
︙ | ︙ | |||
191 192 193 194 195 196 197 198 199 200 201 202 203 204 | } } } 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 | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | } } } else { error "unsupported language, no idea how to modify auto-path" } } # # NOTE: This procedure verifies the combination of language and version # specified by the caller. 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 varName argument is the name # of a scalar variable in the context of the immediate caller that # will receive a boolean value indicating if the specified language # is actually a reference to the package downloader client itself. # proc verifyLanguageAndVersion { language version varName } { if {[string length $varName] > 0} then { upvar 1 $varName isClient } set isClient 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 isClient true } else { error "unsupported language" } } # # NOTE: This procedure checks if there is a higher version available of the # specified package on the package file server. 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 packageName argument # is a directory name relative to the language and version-specific # directory on the package file server and may be an empty string. The # usePgp argument should be non-zero when an OpenPGP signature file # needs to be downloaded and verified for the downloaded file. # # <public> proc checkForHigherVersion { language version packageName usePgp } { variable clientDirectory variable temporaryRootDirectory verifyLanguageAndVersion $language $version isClient set temporaryDirectory [file join \ $temporaryRootDirectory [appendArgs \ pkgd_ver_ [getUniqueDirectorySuffix]]] if {$isClient} then { set persistentDirectory $clientDirectory } else { set persistentDirectory $persistentRootDirectory } set fileName [file join $packageName VERSION] set downloadFileName [file join $temporaryDirectory $fileName] file mkdir [file dirname $downloadFileName] downloadOneFile $language $version $fileName $downloadFileName $usePgp if {$usePgp} then { downloadOneFile $language $version [appendArgs $fileName .asc] \ [appendArgs $downloadFileName .asc] $usePgp } set localFileName [file join $persistentDirectory $fileName] if {[package vcompare \ [string trim [readFile $downloadFileName]] \ [string trim [readFile $localFileName]]] > 0} then { return true } else { return false } } # # 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 |
︙ | ︙ | |||
227 228 229 230 231 232 233 | # # 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 { | | | | 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | # # 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 -binary true] } # # NOTE: Is use of OpenPGP for signature verification enabled? Also, # did we just download an OpenPGP signature file? # if {$usePgp && [isPgpSignatureFileName $localFileName true]} then { |
︙ | ︙ | |||
272 273 274 275 276 277 278 | # <public> proc downloadFiles { language version fileNames persistent usePgp useAutoPath } { variable clientDirectory variable persistentRootDirectory variable temporaryRootDirectory | < | < < < | < < < < < < < < < < < < < < | | < > | | 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | # <public> proc downloadFiles { language version fileNames persistent usePgp useAutoPath } { variable clientDirectory variable persistentRootDirectory variable temporaryRootDirectory verifyLanguageAndVersion $language $version isClient set temporaryDirectory [file join \ $temporaryRootDirectory [appendArgs \ pkgd_lib_ [getUniqueDirectorySuffix]]] if {$isClient} then { set persistentDirectory $clientDirectory } else { set persistentDirectory $persistentRootDirectory } set downloadedFileNames [list] |
︙ | ︙ | |||
363 364 365 366 367 368 369 | if {$persistent} then { set fileNameOnly [lindex $downloadedFileName 0] set directory(persistent) [lindex $downloadedFileName 2] file mkdir $directory(persistent) set command [list file copy] | | | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | if {$persistent} then { set fileNameOnly [lindex $downloadedFileName 0] set directory(persistent) [lindex $downloadedFileName 2] file mkdir $directory(persistent) set command [list file copy] if {$isClient} then { lappend command -force } lappend command -- lappend command [file join $directory(temporary) $fileNameOnly] lappend command [file join $directory(persistent) $fileNameOnly] |
︙ | ︙ |
Modified client/1.0/pkgd.eagle.asc from [30c97f97a1] to [624f566b09].
1 2 3 4 | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository iQIcBAABCAAGBQJXt5RqAAoJEFAslq9JXcLZcTsQALpS7Eu6mlGbfXKEH/hyL7cI 89NHNHpThrJ972rb8qj8PX7MyCxEaWCuYeumdBLctB68k56f1Mej9NTf8vdV+aJp NgpGjTwZ0WskmfaI7QbVd4+IyKNoh5+g09rN4T63L11ds0g1BbwF1E2KJL82l0Sv XeyLAKOvznTOStmuS42ES60Cy1atPTTeqCwU+qmmazz9hxuzUe/QFqcK+1Tj3Yed mY/+tNjH1jYtGfwfipeMcpGE1jfY7dEXBQW/8i5R89cw99w42MTXvEouEICjZTdc TX5/woJFXpqDKvr7gdHkJd6IGyXJIOOsBvsOuF2PbSgj3kLGb4I3YOkSS3mZiOcn kQ89Tr8tz9B936oY/kB+g4ggI3O+e3eXGrBI56NhFZuTMYoIVHuAiHAdZQlWxtQt Uinqv6/k13auivCBHZ7+Ji+BcIbHuqgXuheDw88XwpL/zRrPsGEwblwrEAIvQDsT kHcrsh0vW/6uBxy5CGlxt5gaYidtiMqEXBob3uFiFQIfQpS7MXB7a45MMYdT6RYN kd8pN+mYf58x1joEgnSJSOjHIYayZjPzHMrYBqxl84t8SrzYUCXBDu0edSjj4cAB 0wqJnDlP2Z8DYDfnRSyPla+IsyjKSHMFF24kbMue6OjeBxcdBlhecN0yV+xdEf7B 46u1TdrHuYAJt2E4YzJp =/psR -----END PGP SIGNATURE----- |
Modified client/1.0/pkgd.eagle.harpy from [a4cd057d71] to [8aaba801f4].
︙ | ︙ | |||
17 18 19 20 21 22 23 | THE ASSOCIATED SOFTWARE MAY NOT WORK PROPERLY IF THIS FILE IS ALTERED. --> <Certificate xmlns="https://eagle.to/2011/harpy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Protocol>None</Protocol> <Vendor>Mistachkin Systems</Vendor> | | | | | | | | | | | | | | | | | | | | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | THE ASSOCIATED SOFTWARE MAY NOT WORK PROPERLY IF THIS FILE IS ALTERED. --> <Certificate xmlns="https://eagle.to/2011/harpy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Protocol>None</Protocol> <Vendor>Mistachkin Systems</Vendor> <Id>c787e54c-9543-4fa4-9d61-ed59debfd70f</Id> <HashAlgorithm>SHA512</HashAlgorithm> <EntityType>Script</EntityType> <TimeStamp>2016-08-19T23:20:52.9053203Z</TimeStamp> <Duration>-1.00:00:00</Duration> <Key>0x2c322765603b5278</Key> <Signature> dtIbyZb0fgJx0ee+GJqoS4vR8PgZLotiACYhXFarqAaxr965C7yQ9pUvrEVgZpMwKGsqDr0VpwoX sHZbHW5M97eTxwUa+Pd2YckJ0tmBaSnc3a7olHwWWLfUHPdgVgmLJw8pMu2TEA1S3zKzzNdehEKS 2oDz3Dxg6FZG5HqclReIX760hxDohBvJKEODQq6hUKC1SaHsTLNhWt5c+vCpvPgtpK2E2j/sTwR8 7MWxE8kcNXUH9AqcM7F/1KxdZcMrBhzmmiJowpXIL11wjkO4LheNAyrfr6bJ7LO5+fHMhkLKkNLq 0mqqABt6/gdNe3EEhNdhy7BUbVLDFk3u8J9HQmbh4soVZeWQT6PqOn2Zq5+z+QvxwechUdK/Jbae Htf3ueSNi9Lm93SJhf90SF3JvwcqgdHE5aWdw9ng4EVq5jB0HwPPu0gD7XOUKo6XQko4WOtj4lR3 K99oi2nUBmv7Z0dJWNN+g+UzD1RpdKWa3sMQxs1b9ZFRPi+r30L3vQjJO0cBp3PsRkWoiV+tj92s f4WU4xzejptNMoTT2KH0vgRSgNdAUNJgAzM00jSgBF4tOa2QOVvlmx60YNrRr7NibZoeyqQetOgR 7G/bxdD+xWJAGs2QfJ9LFk66t9G9Rw9XMuBlIz4jIga93ia7jcwT3GwiYlv2RI5KpnEMSrZ5aLCB FxoD4op0jdfAuYvbQNJHNYKnDO4kXhzdxPxX2qjOqJ5XSH+tB9WGtmRiIbqeIlvoeP7x887h+ZnS 1BT0PBEJC8f/KXZWFn6nQ8FBJN7xTWYKgKnAFAAnl1vJFb7UB9FSe6isPhfcK3lCfL/jbF7gJJfH V69uIfMA1O/vNS+3nm+FFM6AsPa16W5uXuykreHR9nhGwN0o+o87D4eWYmN/CkP10rMNOquMvsN0 HumTEW50lSBhLNrdVh3bujpBv5QfHouCNg1Pn6IcJLLutXXbgH20yyitfWwYb9u6BISHfZshngFw LgxAquR8aoJydotC43JpixnJsar7y9+V+V0X2u6kYRA+ePD6DT4KM2K4JEIO0rfiYwMniLFjAN3T L7iZ8puaBf/3ENCMKLb7B0vVtkfgb67gJpsuU1UqMeYEyr5rgZnTXx1vG1H2k8U6UBTXXvFJtkWw OCrHxaG2w8SPUjY8r1KVEfaHfaxvgaWe8/LQubQWtj0D9qPQqgIUA+MIQeWPZyh2C5hCUraGdqs6 ZeoKFc+wGyi+5nF35wMkf+ftsiSp1t02EMEmyDIMK95gnGbDDSLWD2Ox46Pk6RvZDkW4sm46ufDf XXBBxxtX4uK9h6Jvpw2oVR/P2f9kRYwF0wG8x8vjuXiyn/iDWXBb3oyeo2ImQQGM98JSRlQ1rw== </Signature> </Certificate> |
Modified client/1.0/pkgd.eagle.harpy.asc from [9fed349699] to [06d6b4e54d].
1 2 3 4 | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository iQIcBAABCAAGBQJXt5RrAAoJEFAslq9JXcLZJpEP/27cOy348eY7K6yPyIg3c626 c2G0l7EM9Wp+9XuutyI6g2QFf4Y9zjMmsYaNaFFyHM2MC2MPrj3B7g1t9t7p+jPq o4f6Zt9R1ordVTcD4obKKdjZkn+Ww4F9q6YuKSFBhZ3zT/5DF9arNrC3JhQEL3YB /eCFqLS1p9hsHWTaT5Tb0uz1wYR2O+dPl74DxOcXSjACixZZPqhWzpxAmXesc2Aq C51AOg5djF9obIaPIsGEngEEk8///HHSjuJRHZjyu2ugIlMoBUIt4cyJC+wt3v7C 2LcK5C52YuW+WJwUxAN0LAuMNVFsdZSVutYS2I9zAYPMl3MYmW1UIfoFgit5CoIu sRRyl6uP11bNSAICrfAoSUPn405yFtqCk80bTvOXu6Ager1kg0GGhMFF1uVCl8ap 1UgZIthwqp7o0p5bsqK0L63j5HKEGlNyW9PuWxhmpcegd0nbosA5Yzj3iAeSnv1H hteHAE9ZiNcBs8BmHifdVxSGfKtuBnG55BzgOzLPTDibmecdAIJCPRTCv4UhPCzw HW1xzjz4jLArtscskeNw4cPNXAVzJSB1y9mV/iqq+6PJimKwSfzLrpkVuHRlEM+C 3OpyAue+14PKqrD1EIdsZ6Owa3d2dwddbQjsooyjm0180n+LEDR3AWcOxWg0I4Pp HOMPUI/J6/zxi6Cs3eFQ =NzCV -----END PGP SIGNATURE----- |