Diff
Not logged in

Differences From Artifact [9ace2abafb]:

To Artifact [8ca4ea040d]:


698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
698
699
700
701
702
703
704





























705
706
707
708
709
710
711







-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-







        }
      }
    }

    return ""
  }

  #
  # NOTE: This procedure attempts to guess a package name based on a list of
  #       its files.  It relies upon the fact that all packages must include
  #       a package index file.  The language argument must be one of the
  #       literal strings "eagle", "tcl", or "client".  The fileNames argument
  #       must be the list of file names to be downloaded.  The package name,
  #       if one can be detected, is returned; otherwise, an empty string will
  #       be returned.
  #
  proc guessPackageNameFromFileNames { language fileNames } {
    set packageIndexFileName [getPackageIndexFileName $language]

    if {[string length $packageIndexFileName] > 0} then {
      foreach fileName $fileNames {
        set fileNameOnly [file tail $fileName]

        if {$fileNameOnly eq $packageIndexFileName} then {
          set directory [file dirname $fileName]

          if {[string length $directory] > 0} then {
            return [file tail $directory]
          }
        }
      }
    }

    return ""
  }

  #
  # 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
  #       varName argument is the name of a variable in the context of the
1091
1092
1093
1094
1095
1096
1097





























1098
1099
1100
1101
1102
1103
1104
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104







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







    } else {
      file delete -force -- $temporaryDirectory
    }

    return [expr {$compare > 0}]
  }

  #
  # NOTE: This procedure attempts to guess a package name based on a list of
  #       its files.  It relies upon the fact that all packages must include
  #       a package index file.  The language argument must be one of the
  #       literal strings "eagle", "tcl", or "client".  The fileNames argument
  #       must be the list of file names to be downloaded.  The package name,
  #       if one can be detected, is returned; otherwise, an empty string will
  #       be returned.
  #
  proc guessPackageNameFromFileNames { language fileNames } {
    set packageIndexFileName [getPackageIndexFileName $language]

    if {[string length $packageIndexFileName] > 0} then {
      foreach fileName $fileNames {
        set fileNameOnly [file tail $fileName]

        if {$fileNameOnly eq $packageIndexFileName} then {
          set directory [file dirname $fileName]

          if {[string length $directory] > 0} then {
            return [file tail $directory]
          }
        }
      }
    }

    return ""
  }

  #
  # NOTE: This procedure downloads a manitest from the package file server,
  #       writing its contents to the specified local file name.  It can also
  #       verify the OpenPGP signature.  The language argument must be one of
  #       the literal strings "eagle", "tcl", or "client".  The version
  #       argument 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
1128
1129
1130
1131
1132
1133
1134
1135

1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1128
1129
1130
1131
1132
1133
1134

1135

















1136
1137
1138
1139
1140
1141
1142







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







    #
    set uri [subst $platformsUri]

    #
    # NOTE: Then, in one step, download the file from the package file
    #       server and write it to the specified local file.
    #
    writeFile $localFileName [getPackageFile $uri]
    downloadOneUriToFile $localFileName $uri $usePgp

    #
    # NOTE: Is use of OpenPGP for signature verification enabled?  Also,
    #       did we just download an OpenPGP signature file?
    #
    if {$usePgp && [isOpenPgpSignatureFileName $localFileName true]} then {
      #
      # NOTE: Attempt to verify the OpenPGP signature.  If this fails,
      #       an error is raised.
      #
      ::PackageRepository::openPgpMustBeInstalled

      if {![::PackageRepository::verifyOpenPgpSignature $localFileName]} then {
        error [appendArgs \
            "bad OpenPGP signature \"" $localFileName \"]
      }
    }

    #
    # NOTE: Initialize list of platforms to return.  This will be populated
    #       based on the platform directories available in the downloaded
    #       manfiest data.
    #
    set platforms [list]
1199
1200
1201
1202
1203
1204
1205

































1206
1207
1208
1209
1210
1211
1212
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228







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







    } else {
      file delete -force -- $temporaryDirectory
    }

    return [lsort -unique $platforms]
  }

  #
  # NOTE: This procedure downloads a single URI from the package file server
  #       and writes the result to a local file.  The localFileName argument
  #       is the file name where the downloaded file should be written.  The
  #       The uri argument is the URI to download.  The usePgp argument should
  #       be non-zero when the OpenPGP signature file needs to be verified for
  #       the downloaded file.  The return value is undefined.
  #
  proc downloadOneUriToFile { localFileName uri usePgp } {
    #
    # NOTE: Then, in one step, download the URI from the package file
    #       server and write it to the specified local file.
    #
    writeFile $localFileName [getPackageFile $uri]

    #
    # NOTE: Is use of OpenPGP for signature verification enabled?  Also,
    #       did we just download an OpenPGP signature file?
    #
    if {$usePgp && [isOpenPgpSignatureFileName $localFileName true]} then {
      #
      # NOTE: Attempt to verify the OpenPGP signature.  If this fails,
      #       an error is raised.
      #
      ::PackageRepository::openPgpMustBeInstalled

      if {![::PackageRepository::verifyOpenPgpSignature $localFileName]} then {
        error [appendArgs \
            "bad OpenPGP signature \"" $localFileName \"]
      }
    }
  }

  #
  # NOTE: This procedure downloads a single file from the package file server,
  #       writing its contents to the specified local file name.  It can also
  #       verify the OpenPGP signatures.  When an OpenPGP signature file is
  #       downloaded, this procedure assumes the corresponding data file was
  #       already downloaded (i.e. since OpenPGP needs both to perform the
  #       signature checks).  The language argument must be one of the
1234
1235
1236
1237
1238
1239
1240
1241

1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254


1255
1256
1257
1258
1259

1260
1261
1262
1263
1264
1265
1266
1267
1268
1250
1251
1252
1253
1254
1255
1256

1257













1258
1259





1260


1261
1262
1263
1264
1265
1266
1267







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







    # NOTE: First, build the full relative file name to download from
    #       the remote package repository.
    #
    set fileName [file join $language $version $platform $fileName]
    set uri [subst $downloadUri]

    #
    # NOTE: Then, in one step, download the file from the package file
    # NOTE: Download the file from the package file server, based on the
    #       server and write it to the specified local file.
    #
    writeFile $localFileName [getPackageFile $uri]

    #
    # NOTE: Is use of OpenPGP for signature verification enabled?  Also,
    #       did we just download an OpenPGP signature file?
    #
    if {$usePgp && [isOpenPgpSignatureFileName $localFileName true]} then {
      #
      # NOTE: Attempt to verify the OpenPGP signature.  If this fails,
      #       an error is raised.
      #
    #       final URI.
    #
      ::PackageRepository::openPgpMustBeInstalled

      if {![::PackageRepository::verifyOpenPgpSignature $localFileName]} then {
        error [appendArgs \
            "bad OpenPGP signature \"" $localFileName \"]
    downloadOneUriToFile $localFileName $uri $usePgp
      }
    }
  }

  #
  # NOTE: This procedure attempts to download a list of files, optionally
  #       persistening them for subsequent uses by the target language.
  #       The language argument must be one of the literal strings "eagle",
  #       "tcl", or "client".  The version argument must be one of the