Diff
Not logged in

Differences From Artifact [809fd86192]:

To Artifact [825e8f4207]:


945
946
947
948
949
950
951

952

953
954

955
956
957
958




959
960
961

962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980












981
982
983
984
985
986
987
945
946
947
948
949
950
951
952

953
954

955
956



957
958
959
960
961
962

963

964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000







+
-
+

-
+

-
-
-
+
+
+
+


-
+
-


















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







  #       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 language is either "eagle"
  #       or "client".  The fileNames argument must be a well-formed list
  #       of file names to download, each one relative to the language and
  #       version-specific directory on the package file server.  The
  #       options argument must be a dictionary of name/value pairs.  The
  #       persistent argument should be non-zero if the downloaded files
  #       -persistent option should be non-zero if the downloaded files
  #       should be saved to permanent storage for subsequent use.  The
  #       usePgp argument should be non-zero when an OpenPGP signature file
  #       -usePgp option should be non-zero when an OpenPGP signature file
  #       needs to be downloaded and verified for each downloaded file.  The
  #       useAutoPath argument should be non-zero to modify the auto-path
  #       to include the temporary or persistent directories containing
  #       the downloaded files.
  #       -useAutoPath option should be non-zero to modify the auto-path to
  #       include the temporary or persistent directories containing the
  #       downloaded files.  The -allowUpdate option should be non-zero to
  #       allow existing package files to be overwritten.
  #
  # <public>
  proc downloadFiles {
  proc downloadFiles { language version fileNames options } {
          language version fileNames persistent usePgp useAutoPath } {
    variable clientDirectory
    variable persistentRootDirectory
    variable temporaryRootDirectory
    variable viaInstall

    verifyLanguageAndVersion $language $version isClient

    set temporaryDirectory [file join \
        $temporaryRootDirectory [appendArgs \
        pkgd_lib_ [::PackageRepository::getUniqueSuffix]]]

    if {$isClient} then {
      set persistentDirectory $clientDirectory
    } else {
      verifyPersistentRootDirectory
      set persistentDirectory $persistentRootDirectory
    }

    set persistent [string is true -strict \
        [getDictionaryValue $options -persistent]]

    set usePgp [string is true -strict \
        [getDictionaryValue $options -usePgp]]

    set useAutoPath [string is true -strict \
        [getDictionaryValue $options -useAutoPath]]

    set allowUpdate [string is true -strict \
        [getDictionaryValue $options -allowUpdate]]

    set downloadedFileNames [list]

    foreach fileName $fileNames {
      if {[string length $fileName] == 0 || \
          [file pathtype $fileName] ne "relative"} then {
        error [appendArgs \
            "bad file name \"" $fileName "\", not relative"]
1013
1014
1015
1016
1017
1018
1019

1020

1021
1022
1023
1024
1025
1026
1027
1026
1027
1028
1029
1030
1031
1032
1033

1034
1035
1036
1037
1038
1039
1040
1041







+
-
+








      file mkdir [file dirname $downloadFileName]
      downloadOneFile $language $version $fileName $downloadFileName $usePgp

      lappend downloadedFileNames [list \
          $fileNameOnly $directory(temporary) $directory(persistent)]

      if {$usePgp && \
      if {$usePgp && ![isOpenPgpSignatureFileName $downloadFileName true]} then {
          ![isOpenPgpSignatureFileName $downloadFileName true]} then {
        downloadOneFile $language $version [appendArgs $fileName .asc] \
            [appendArgs $downloadFileName .asc] $usePgp

        lappend downloadedFileNames [list \
            [appendArgs $fileNameOnly .asc] $directory(temporary) \
            $directory(persistent)]
      }
1037
1038
1039
1040
1041
1042
1043
1044


1045
1046

1047
1048
1049
1050
1051
1052
1053
1051
1052
1053
1054
1055
1056
1057

1058
1059
1060

1061
1062
1063
1064
1065
1066
1067
1068







-
+
+

-
+







        set directory(persistent) [lindex $downloadedFileName 2]

        file mkdir $directory(persistent)
        set command [list file copy]

        #
        # NOTE: When updating the package repository client files, always
        #       use the -force option to overwrite existing files.
        #       use the -force option to overwrite existing files.  Also,
        #       if we are allow updates, use the -force option.
        #
        if {$isClient} then {
        if {$isClient || $allowUpdate} then {
          lappend command -force
        }

        lappend command --
        lappend command [file join $directory(temporary) $fileNameOnly]
        lappend command [file join $directory(persistent) $fileNameOnly]