Overview
Comment: | Add support for multiple API keys. Change package variable prefix to 'pkgr' instead of 'rpkg'. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7c3824bfd199e1b1c6c82ef3a0c9d7e5 |
User & Date: | mistachkin on 2016-08-17 17:59:05 |
Other Links: | manifest | tags |
Context
2016-08-17
| ||
18:03 | Minor tweaks. check-in: 4b4b277a8b user: mistachkin tags: trunk | |
17:59 | Add support for multiple API keys. Change package variable prefix to 'pkgr' instead of 'rpkg'. check-in: 7c3824bfd1 user: mistachkin tags: trunk | |
06:18 | Do not try to auto-hook the 'package unknown' handler if it is already hooked. check-in: e7c21e360a user: mistachkin tags: trunk | |
Changes
Modified client/pkgr.eagle from [0ed7e11999] to [0f2d183af8].
︙ | ︙ | |||
143 144 145 146 147 148 149 | } } return false } proc getLookupVarNamePrefix {} { | | | | | | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | } } return false } proc getLookupVarNamePrefix {} { return ::pkgr_; # TODO: Make non-global? } proc getLookupVarNameSuffix {} { return [appendArgs \ [string trim [pid] -] _ [string trim [clock seconds] -] _ \ [string trim [clock clicks -milliseconds] -]]; # TODO: Bad? } proc getLookupApiKeys {} { set varName [appendArgs [getLookupVarNamePrefix] api_keys] if {[info exists $varName]} then { return [set $varName] } global env set varName [string trim $varName :] if {[info exists env($varName)]} then { return $env($varName) } return [list]; # NOTE: System default, which is "public-only". } proc getLookupBaseUri {} { set varName [appendArgs [getLookupVarNamePrefix] base_uri] if {[info exists $varName]} then { return [set $varName] |
︙ | ︙ | |||
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | append requirement .0 } return $requirement } proc getLookupData { apiKey package version } { set uri [getLookupUri $apiKey $package $version] if {[string length $uri] == 0} then { return "" } if {[isEagle]} then { set data [uri download -inline $uri] } else { variable quiet set data [getFileViaHttp $uri 10 stdout $quiet] | > > > > > > > | 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 | append requirement .0 } return $requirement } proc getLookupData { apiKey package version } { variable verboseUriDownload set uri [getLookupUri $apiKey $package $version] if {[string length $uri] == 0} then { return "" } if {$verboseUriDownload} then { pkgLog [appendArgs \ "attempting to download URI \"" $uri \"...] } if {[isEagle]} then { set data [uri download -inline $uri] } else { variable quiet set data [getFileViaHttp $uri 10 stdout $quiet] |
︙ | ︙ | |||
441 442 443 444 445 446 447 | # # NOTE: Create common cleanup script block that deletes any temporary # files created for the script verification process. # set script(cleanup) { if {[string length $fileName(2)] > 0 && \ [file exists $fileName(2)]} then { | | | | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | # # NOTE: Create common cleanup script block that deletes any temporary # files created for the script verification process. # set script(cleanup) { if {[string length $fileName(2)] > 0 && \ [file exists $fileName(2)]} then { if {![info exists ::env(pkgr_keep_files)]} then { catch {file delete $fileName(2)} } unset -nocomplain fileName(2) } if {[string length $fileName(1)] > 0 && \ [file exists $fileName(1)]} then { if {![info exists ::env(pkgr_keep_files)]} then { catch {file delete $fileName(1)} } unset -nocomplain fileName(1) } } # |
︙ | ︙ | |||
915 916 917 918 919 920 921 | # is called? # variable verboseUnknownResult; # DEFAULT: false if {![info exists verboseUnknownResult]} then { set verboseUnknownResult false } | | | > > > > > > > > > > > > > > > > | | | | | | | | > > > > > > > > | 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 | # is called? # variable verboseUnknownResult; # DEFAULT: false if {![info exists verboseUnknownResult]} then { set verboseUnknownResult false } # # NOTE: Emit diagnostic messages when a URI is fetched? # variable verboseUriDownload; # DEFAULT: false if {![info exists verboseUriDownload]} then { set verboseUriDownload true } } proc main { package version caller } { # # NOTE: Get the list of API keys and try each one, in order, until # the package is found. # set apiKeys [getLookupApiKeys]; lappend apiKeys "" foreach apiKey $apiKeys { # # NOTE: Issue the lookup request to the remote package repository. # set data [getLookupData \ $apiKey $package [getLookupVersion $version]] # # NOTE: Attempt to grab the lookup code from the response data. # set code [getLookupCodeFromData $data] # # NOTE: Did the lookup operation fail? # if {[isLookupCodeOk $code]} then { break } } # # NOTE: Attempt to grab the lookup data from the response data. # Upon failure, this should contain the error message. # set result [getLookupResultFromData $data] |
︙ | ︙ |
Modified client/pkgr.eagle.harpy from [6ca32d7096] to [fa937e4643].
︙ | ︙ | |||
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>bfdbe096-dec1-44fd-8613-e85207fd978f</Id> <HashAlgorithm>SHA512</HashAlgorithm> <EntityType>Script</EntityType> <TimeStamp>2016-08-17T17:57:27.3230000Z</TimeStamp> <Duration>-1.00:00:00</Duration> <Key>0x2c322765603b5278</Key> <Signature> jnDTALzAu1rGArYg8lWmyGctwZJkHKocMDcC6GASPLrohXecFpc5EFldHdgm+pQTV8oFgvozd6eJ M0Qn58D9Rcam+669yn8Nrk3uqxEEd2fkkAOvuK/SRThR5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