Diff
Not logged in

Differences From Artifact [abdfdd95a7]:

To Artifact [770ff42b10]:


33
34
35
36
37
38
39











40
41
42
43
44
45
46
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57







+
+
+
+
+
+
+
+
+
+
+







    #
    variable openPgpKeyUrn; # DEFAULT: pkg_keys

    if {$force || ![info exists openPgpKeyUrn]} then {
      set openPgpKeyUrn pkg_keys
    }

    #
    # NOTE: The fallback URN, relative to the base URI, where the Package
    #       Signing Keys may be downloaded.  This should only be used when
    #       the primary URN did not produce valid data.
    #
    variable openPgpKeyUrnFallback; # DEFAULT: pkg_keys_mirror_1

    if {$force || ![info exists openPgpKeyUrnFallback]} then {
      set openPgpKeyUrnFallback pkg_keys_mirror_1
    }

    #
    # NOTE: The URN, relative to the base URI, where a login request may
    #       be sent.
    #
    variable loginUrn; # DEFAULT: pkgd_login

    if {$force || ![info exists loginUrn]} then {
117
118
119
120
121
122
123












124
125
126
127
128
129
130
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153







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







    #       should return a payload containing the OpenPGP key data.
    #
    variable openPgpKeyUri; # DEFAULT: ${baseUri}/${openPgpKeyUrn}

    if {$force || ![info exists openPgpKeyUri]} then {
      set openPgpKeyUri {${baseUri}/${openPgpKeyUrn}}
    }

    #
    # NOTE: The fallback URI where the Package Signing Keys may be
    #       downloaded.  This should return a payload containing the OpenPGP
    #       key data.  This should only be used when the primary URN did not
    #       produce valid OpenPGP key data.
    #
    variable openPgpKeyUriFallback; # DEFAULT: .../${openPgpKeyUrnFallback}

    if {$force || ![info exists openPgpKeyUriFallback]} then {
      set openPgpKeyUriFallback {${baseUri}/${openPgpKeyUrnFallback}}
    }

    #
    # NOTE: The URI where a login request may be sent.  This should return a
    #       payload containing the necessary HTTP(S) cookie information.
    #
    variable loginUri; # DEFAULT: ${baseUri}/${loginUrn}?...

471
472
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
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
551
552
553







+

+

+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+

-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







  #       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 } {
    variable baseUri
    variable openPgpKeyUri
    variable openPgpKeyUriFallback
    variable openPgpKeyUrn
    variable openPgpKeyUrnFallback

    set errors [list]
    #
    # NOTE: First, build the final URI to download from the remote package
    #       repository.
    #
    set uri [subst $openPgpKeyUri]

    foreach substUri [list $openPgpKeyUri $openPgpKeyUriFallback] {
      #
      # NOTE: Attempt to download the Package Signing Keys using the
      #       configured URI.
      #
      if {[catch {
        #
        # NOTE: First, build the actual URI where the Package Signing
        #       Keys should be obtained.
        #
        set uri [subst $substUri]

    #
    # NOTE: Then, in one step, download the file from the package file
    #       server and write it to the specified local file.
    #
    downloadOneUriToFile $fileName $uri false
        #
        # NOTE: Then, in one step, download the file from the package
        #       file server and write it to the specified local file.
        #
        downloadOneUriToFile $fileName $uri false
      } result] == 0} then {
        #
        # NOTE: Ok, success.  We are done.
        #
        return ""
      } else {
        #
        # NOTE: Keep track of all errors that are encountered while
        #       trying to download the Package Signing Keys, for later
        #       reporting.
        #
        lappend errors [list $uri $result]
      }
    }

    #
    # NOTE: Make sure there is always an error message.
    #
    if {[llength $errors] == 0} then {
      lappend errors "no URIs are available for package signing keys"
    }

    error $errors
  }

  #
  # NOTE: This procedure returns non-zero if the specified file seems to be
  #       an OpenPGP signature file.  The fileName argument is the name of
  #       the file to check, which may or may not exist.  The nameOnly
  #       argument should be non-zero to ignore the contents of the file.