Diff
Not logged in

Differences From Artifact [e26961fb7d]:

To Artifact [9a9904770b]:


85
86
87
88
89
90
91












92
93
94
95
96
97
98
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110







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








    if {![info exists downloadUri]} then {
      set downloadUri [string trim {
        ${baseUri}/pkgd_file?download&ci=trunk&filename=${fileName}
      }]
    }

    #
    # NOTE: The URI where the logout request should be sent.  This should
    #       return a payload indicating that the logout was successful.
    #
    variable logoutUri; # DEFAULT: ${baseUri}/pkgd_logout?...

    if {![info exists logoutUri]} then {
      set logoutUri [string trim {
        ${baseUri}/pkgd_logout?authToken=${authToken}
      }]
    }

    #
    # NOTE: The root directory where any persistent packages will be saved.
    #
    variable persistentRootDirectory; # DEFAULT: [getPersistentRootDirectory]

    if {![info exists persistentRootDirectory]} then {
      set persistentRootDirectory [getPersistentRootDirectory]
351
352
353
354
355
356
357
358














































359
360
361
362
363
364
365
363
364
365
366
367
368
369

370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422







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







    #
    # NOTE: Set the login cookie to the one freshly extracted from the raw
    #       response data.
    #
    set loginCookie [list $loginCookieName $authToken]

    #
    # NOTE: Always return an empty string (i.e. and not the login data).
    # NOTE: Always return an empty string (i.e. and not any response data).
    #
    return ""
  }

  proc logoutAndResetCookie {} {
    variable baseUri
    variable loginCookie
    variable logoutUri

    #
    # NOTE: Attempt to verify that we are currently logged in.
    #
    if {![info exists loginCookie] || [llength $loginCookie] != 2} then {
      error "missing or invalid login cookie"
    }

    #
    # NOTE: Build the full URI for the logout request.
    #
    set authToken [lindex $loginCookie 1]
    set uri [subst $logoutUri]

    #
    # NOTE: Reset the old login cookie, if any.  Then, issue a new login
    #       request, capturing the raw response data.
    #
    set data [getPackageFile $uri]

    #
    # NOTE: Attempt to extract the necessary values from the raw response
    #       data.
    #
    set pattern(1) {"name":"nobody"}; # TODO: *HACK* Keep updated.

    if {![regexp -- $pattern(1) $data dummy]} then {
      error "logout response missing \"name\""
    }

    #
    # NOTE: Reset the login cookie.
    #
    set loginCookie [list]

    #
    # NOTE: Always return an empty string (i.e. and not any response data).
    #
    return ""
  }

  #
  # NOTE: This procedure checks if there is a higher version available of the
  #       specified package on the package file server.  The language argument