︙ | | |
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
-
+
-
+
-
+
|
# argument is non-zero, any existing values will be overwritten and
# set back to their default values.
#
proc setupDownloadServerVars { force } {
#
# NOTE: The URN, relative to the base URI, where the Package Signing Key
# NOTE: The URN, relative to the base URI, where the Package Signing Keys
# may be downloaded.
#
variable openPgpKeyUrn; # DEFAULT: pkg_key
variable openPgpKeyUrn; # DEFAULT: pkg_keys
if {$force || ![info exists openPgpKeyUrn]} then {
set openPgpKeyUrn pkg_key
set openPgpKeyUrn pkg_keys
}
#
# NOTE: The URN, relative to the base URI, where a login request may
# be sent.
|
︙ | | |
111
112
113
114
115
116
117
118
119
120
121
|
111
112
113
114
115
116
117
118
119
120
121
|
-
+
|
if {$force || ![info exists baseUri]} then {
set baseUri https://urn.to/r
}
#
# NOTE: The URI where the Package Signing Key may be downloaded. This
# NOTE: The URI where the Package Signing Keys may be downloaded. This
# should return a payload containing the OpenPGP key data.
#
variable openPgpKeyUri; # DEFAULT: ${baseUri}/${openPgpKeyUrn}
if {$force || ![info exists openPgpKeyUri]} then {
|
︙ | | |
270
271
272
273
274
275
276
277
278
279
280
281
282
283
|
270
271
272
273
274
275
276
277
278
279
280
|
-
+
-
-
-
|
proc useServerId { {serverId ""} } {
variable downloadUrn
variable loginUrn
variable logoutUrn
if {[string length $serverId] > 0 && \
verifyServerId $serverId
![regexp -nocase -- {^[A-Z][0-9A-Z]*$} $serverId]} then {
error "server Id must be alphanumeric and start with a letter"
}
if {[string length $serverId] > 0} then {
#
# NOTE: Set the URN variables to values that should cause the
# specified server Id to be used (assume the server Id
|
︙ | | |
301
302
303
304
305
306
307
308
309
310
311
312
313
314
|
298
299
300
301
302
303
304
305
306
307
308
|
-
+
-
-
-
|
#
# <public>
proc useVersionId { {versionId ""} } {
variable branchName
if {[string length $versionId] > 0 && \
verifyVersionId $versionId
![regexp -nocase -- {^[0-9A-F]*$} $versionId]} then {
error "version Id must be hexadecimal"
}
if {[string length $versionId] > 0} then {
#
# NOTE: Set the variables to values that should cause the specified
# version Id to be used (assume the version Id itself is valid
|
︙ | | |
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
|
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
|
-
+
-
+
|
return ""
}
#
# NOTE: This procedure attempts to download the Package Signing Key from
# NOTE: This procedure attempts to download the Package Signing Keys from
# the remote server and save it to a local file. This procedure may
# raise script errors. The fileName argument is the name of the file
# where the downloaded data should be written. This procedure is only
# intended to be used from the "pkgr_setup.eagle" tool script and may
# go away in later versions of this package.
#
# <internal>
proc downloadAndSaveOpenPgpKeyFile { fileName } {
proc downloadAndSaveOpenPgpKeysFile { fileName } {
variable baseUri
variable openPgpKeyUri
variable openPgpKeyUrn
#
|
︙ | | |
726
727
728
729
730
731
732
733
734
735
|
720
721
722
723
724
725
726
727
728
729
730
|
+
|
# 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.
#
# <internal>
proc verifyLanguageAndVersion { language version varName } {
if {[string length $varName] > 0} then {
upvar 1 $varName isClient
}
|
︙ | | |
795
796
797
798
799
800
801
802
803
804
|
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
}
}
return ""
}
#
# NOTE: This procedure verifies that the specified value is indeed a valid
# server identifier. The serverId argument is the value to verify.
# This procedure may raise script errors.
#
# <internal>
proc verifyServerId { serverId } {
if {[string length $serverId] > 0 && \
![regexp -nocase -- {^[A-Z][0-9A-Z]*$} $serverId]} then {
error "server Id must be alphanumeric and start with a letter"
}
}
#
# NOTE: This procedure verifies that the specified value is indeed a valid
# version identifier. The versionId argument is the value to verify.
# This procedure may raise script errors.
#
# <internal>
proc verifyVersionId { versionId } {
if {[string length $versionId] > 0 && \
![regexp -nocase -- {^[0-9A-F]*$} $versionId]} then {
error "version Id must be hexadecimal"
}
}
#
# NOTE: This procedure verifies the platform specified by the caller. The
# platform argument must be an empty string -OR- one of the literal
# strings "neutral", "win32-arm", "win32-x86", "win64-arm64",
|
︙ | | |