Diff
Not logged in

Differences From Artifact [6a1409dce3]:

To Artifact [c1156a1489]:


24
25
26
27
28
29
30
31

32
33
34

35
36
37

38
39
40
41
42
43
44
24
25
26
27
28
29
30

31
32
33

34
35
36

37
38
39
40
41
42
43
44







-
+


-
+


-
+







  # NOTE: This procedure sets up the default values for all URN configuration
  #       parameters used by the package downloader client.  If the force
  #       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.
    #
    variable loginUrn; # DEFAULT: pkgd_login
109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123







-
+







    variable baseUri; # DEFAULT: https://urn.to/r

    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 {
      set openPgpKeyUri {${baseUri}/${openPgpKeyUrn}}
    }
268
269
270
271
272
273
274
275

276
277
278
279
280
281
282
283
284
285
268
269
270
271
272
273
274

275



276
277
278
279
280
281
282







-
+
-
-
-







  #
  # <public>
  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
      #       itself is valid and active).
      #
299
300
301
302
303
304
305
306

307
308
309
310
311
312
313
314
315
316
296
297
298
299
300
301
302

303



304
305
306
307
308
309
310







-
+
-
-
-







  #       downloader client so that a specific version will be used.  The
  #       versionId argument must consist only of hexadecimal characters.
  #
  # <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
      #       and active).
      #
466
467
468
469
470
471
472
473

474
475
476
477
478
479
480
460
461
462
463
464
465
466

467
468
469
470
471
472
473
474







-
+







set dir $pkgd(savedDir); unset -nocomplain pkgd
    }]]

    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>
724
725
726
727
728
729
730

731
732
733
734
735
736
737
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732







+







  #       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.
  #
  # <internal>
  proc verifyLanguageAndVersion { language version varName } {
    if {[string length $varName] > 0} then {
      upvar 1 $varName isClient
    }

    set isClient false

793
794
795
796
797
798
799


























800
801
802
803
804
805
806
788
789
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
826
827







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







          }
        }
      }
    }

    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",
  #       "win64-ia64", or "win64-x64".  An empty string means that the
  #       associated entity does not require a specific platform.  The