Overview
Comment: | Always run the originally saved 'package unknown' handler. Also, fixup the package version to prevent sending requirement-spec style package versions to the server. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a629ae4e7c6497c27ce2a445a0f78d04 |
User & Date: | mistachkin on 2016-08-15 20:47:10 |
Other Links: | manifest | tags |
Context
2016-08-15
| ||
21:03 | Enable 'quiet' mode for the package lookup request to the package repository server. check-in: 878e274ae3 user: mistachkin tags: trunk | |
20:47 | Always run the originally saved 'package unknown' handler. Also, fixup the package version to prevent sending requirement-spec style package versions to the server. check-in: a629ae4e7c user: mistachkin tags: trunk | |
19:46 | The ampersand character needs to be unescaped in the returned data from the package server. check-in: 306c8151d8 user: mistachkin tags: trunk | |
Changes
Modified client/pkgr.eagle from [a326722ba1] to [9aa5b5aab0].
︙ | ︙ | |||
56 57 58 59 60 61 62 63 64 65 66 67 68 69 | if {[info exists $varName]} then { return [set $varName] } return ""; # NOTE: System default, which is "public". } proc getLookupBaseUri {} { set varName [appendArgs [getLookupVarNamePrefix] base_uri] if {[info exists $varName]} then { return [set $varName] } | > > > > > > > > > > > > > > > > > > > | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | if {[info exists $varName]} then { return [set $varName] } return ""; # NOTE: System default, which is "public". } proc getLookupVersion { requirement } { if {[set index [string first - $requirement]] != -1} then { incr index -1; set requirement [string range $requirement 0 $index] } if {[set index [string first a $requirement]] != -1 || \ [set index [string first b $requirement]] != -1} then { incr index -1; set requirement [string range $requirement 0 $index] } if {$requirement eq "0"} then { set requirement "" } elseif {[regexp -- {^\d+$} $requirement]} then { append requirement .0 } return $requirement } proc getLookupBaseUri {} { set varName [appendArgs [getLookupVarNamePrefix] base_uri] if {[info exists $varName]} then { return [set $varName] } |
︙ | ︙ | |||
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 | error "package unknown handler is not hooked" } package unknown [set $varName] unset $varName } # # NOTE: This version argument to this procedure must be optional, because # Eagle does not add a version argument when one is not supplied to # the [package require] sub-command itself. # proc packageUnknownHandler { package {version ""} } { if {[catch {main $package $version} error(1)] == 0} then { # | > > > > > > > > > > > > > > > > > > > > > > > | | | | > > > > > > > > > > | | < | | < < | < < < < < | | | < | | 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | error "package unknown handler is not hooked" } package unknown [set $varName] unset $varName } proc runSavedPackageUnknownHandler { package version } { # # NOTE: See if there is a saved [package unknown] handler. If so, then # attempt to use it. # set varName [appendArgs [getLookupVarNamePrefix] saved_package_unknown] set oldHandler [expr {[info exists $varName] ? [set $varName] : ""}] if {[string length $oldHandler] > 0} then { lappend oldHandler $package $version; uplevel #0 $oldHandler } } # # NOTE: This version argument to this procedure must be optional, because # Eagle does not add a version argument when one is not supplied to # the [package require] sub-command itself. # proc packageUnknownHandler { package {version ""} } { # # NOTE: First, run our [package unknown] handler. # if {[catch {main $package $version} error(1)] == 0} then { # # NOTE: The repository [package unknown] handler succeeded, run the # saved [package unknown] handler. # if {[catch { runSavedPackageUnknownHandler $package $version } error(2)] == 0} then { # # NOTE: Success? Just return and let Tcl (or Eagle) handle the # rest. This is the "happy" path. # return } else { # # NOTE: Failure? Attempt to log the error message. # catch { tclLog [appendArgs \ "pkgr: saved handler failed for \"" [appendArgs [string \ trim $package " " $version]] "\", error: " $error(2)] } } } else { # # NOTE: Failure? Attempt to log the error message and then maybe # try the original [package unknown] handler. # catch { tclLog [appendArgs \ "pkgr: new handler failed for \"" [appendArgs [string \ trim $package " " $version]] "\", error: " $error(1)] } # # NOTE: The repository [package unknown] handler failed, run the # saved [package unknown] handler anyway. There is almost # no chance of this actually providing the package. # if {[catch { runSavedPackageUnknownHandler $package $version } error(2)] == 0} then { # # NOTE: Success? Just return and let Tcl (or Eagle) handle the # rest. # return } else { # |
︙ | ︙ | |||
522 523 524 525 526 527 528 | error [array get error] } proc main { package version } { # # NOTE: Issue the lookup request to the remote package repository. # | | > | 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 | error [array get error] } proc main { package version } { # # NOTE: Issue the lookup request to the remote package repository. # set data [getLookupData \ [getLookupApiKey] $package [getLookupVersion $version]] # # NOTE: Attempt to grab the lookup code from the response data. # set code [getLookupCodeFromData $data] # |
︙ | ︙ |
Modified client/pkgr.eagle.harpy from [b3f7c3de66] to [fc092c0b5d].
︙ | ︙ | |||
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>dbd36350-702f-4e2a-8087-a4b40e13524f</Id> <HashAlgorithm>SHA512</HashAlgorithm> <EntityType>Script</EntityType> <TimeStamp>2016-08-15T20:37:30.8308125Z</TimeStamp> <Duration>-1.00:00:00</Duration> <Key>0x2c322765603b5278</Key> <Signature> azosgrwxz2hRxDq3u70bB7tWoRqW4P7d5mKVkbUM9c9h08ShQgF4OCQX3dBkJc3u76KE9pEstTxk MlZ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