Diff
Not logged in

Differences From Artifact [e3d6d4761a]:

To Artifact [3209afd0c1]:


389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
389
390
391
392
393
394
395

396
397
398
399
400
401
402







-







  #       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".  The fileNames argument is the list of
  #       (fully?) qualified file names to be downloaded when the associated
  #       package is being provided.  The options argument is reserved for
  #       future use, it should be an empty list.
  #
  # <public>
  proc createRepositoryScript {
          serverId versionId language version platform fileNames options } {
    ::PackageDownloader::verifyServerId $serverId
    ::PackageDownloader::verifyVersionId $versionId
    ::PackageDownloader::verifyLanguageAndVersion $language $version isClient

    set prologue ""
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
505
506
507
508
509
510
511

512
513
514
515
516
517
518







-







  #       patch level being submitted.  The language argument must be an empty
  #       string, "Tcl", or "Eagle".  If it is an empty string, the current
  #       language will be assumed.  The script argument is the script to be
  #       evaluated when the package needs to be provided.  The certificate
  #       argument is the certificate associated with the script, which may be
  #       an OpenPGP signature or a Harpy script certificate.
  #
  # <public>
  proc submitPackageMetadata {
          apiKey package patchLevel language script certificate } {
    variable verboseMetadataSubmit

    #
    # NOTE: Fetch the submission URI for the package repository server.  If
    #       it is not available for some reason, raise a script error.
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
894
895
896
897
898
899
900

901
902
903
904
905
906
907







-







  }

  #
  # NOTE: This procedure attempts to stage the specified package files using
  #       Fossil.  The fileNames argument is a list of (fully?) qualified
  #       local file names to stage.
  #
  # <public>
  proc stagePackageFiles { language version platform fileNames } {
    variable checkoutDirectory
    variable fossilAddCommand

    verifyCheckoutDirectory

    if {![verifyThereAreNoChanges]} then {
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
947
948
949
950
951
952
953

954
955
956
957
958
959
960







-








  #
  # NOTE: This procedure attempts to commit the staged package files to the
  #       remote package file repository using Fossil.  The varName argument
  #       is the name of a scalar variable in the context of the immediate
  #       caller that will receive the resulting Fossil check-in identifier.
  #
  # <public>
  proc commitPackageFiles { package patchLevel language version varName } {
    variable checkoutDirectory
    variable fossilCommitCommand
    variable fossilCommitPattern

    fossilMustBeInstalled
    verifyCheckoutDirectory
1007
1008
1009
1010
1011
1012
1013

1014
1015
1016
1017
1018
1019
1020
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017







+







  }

  #
  # NOTE: This procedure initializes the array containing data derived from
  #       the command line arguments, if any.  The argv argument should be
  #       the list of command line arguments.
  #
  # <internal>
  proc setupArgumentData { argv } {
    variable argumentData

    if {![info exists argumentData(apiKey)]} then {
      set argumentData(apiKey) ""
    }

1073
1074
1075
1076
1077
1078
1079

1080
1081
1082
1083
1084
1085
1086
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084







+








  #
  # NOTE: This procedure is used to determine if all the package submission
  #       data is available.  There are no arguments.  Non-zero is returned
  #       if all the package submission data is available.  This procedure
  #       should not raise script errors.
  #
  # <internal>
  proc haveArgumentData {} {
    variable argumentData

    if {![info exists argumentData(apiKey)]} then {
      return false
    }

1209
1210
1211
1212
1213
1214
1215

1216
1217
1218
1219
1220
1221
1222
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221







+







  #
  # NOTE: This procedure is an event handler.  It handles the submit button in
  #       both Tk and Eagle.  It starts the package submission process.  The
  #       args argument is not really used, it is a placeholder to make this
  #       procedure more portable between Tcl and Eagle.  This procedure may
  #       raise script errors.
  #
  # <internal>
  proc submitEventHandler { args } {
    variable argumentData

    set batchMode [lindex $args 0]

    if {[isEagle]} then {
      set sender [lindex $args 1]; # NOTE: Disposal.
1348
1349
1350
1351
1352
1353
1354

1355
1356
1357
1358
1359
1360
1361
1362
1363
1364



1365
1366
1367
1368
1369
1370
1371
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374







+










+
+
+







  }

  #
  # NOTE: This procedure creates the user interface for this tool using Eagle
  #       and WinForms.  The existing argument data, if any, will be used to
  #       populate it.  There are no arguments.
  #
  # <internal>
  proc setupWinFormsUserInterface {} {
    variable argumentData
    variable widgets

    object load -import System.Windows.Forms

    set form [object create -alias Form]
    set widgets(0) $form

    $form Text "Package Uploader Client"
    $form MaximizeBox false
    $form AutoSize true
    $form add_Closed [namespace code [list handleFormClosedEvent]]

    ###########################################################################

    set widgets(1) [object create -alias Label]
    $widgets(1) Name lblApiKey
    $widgets(1) Text "API Key"

1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536

1537
1538
1539
1540
1541
1542
1543
1520
1521
1522
1523
1524
1525
1526



1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544







-
-
-










+







      $widgets($name) Top $top
      $form Controls.Add $widgets($name)

      incr top [$widgets($name) Height]
      incr top $verticalMargin
    }

    $form add_Closed [namespace code [list handleFormClosedEvent]]
    $form MaximizeBox false
    $form AutoSize true
    $form Show

    after 0 [list nop]; # NOTE: Needed for the [vwait].
  }

  #
  # NOTE: This procedure creates the user interface for this tool using Tcl
  #       and Tk.  The existing argument data, if any, will be used to
  #       populate it.  There are no arguments.
  #
  # <internal>
  proc setupTkUserInterface {} {
    variable widgets

    package require Tk
    catch {console show}

    catch {wm withdraw .}; set toplevel [toplevel .uploader]