Overview
Comment: | Add support for automatically detecting the platform for a package to be downloaded. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
6919e920331d41d0e1f46b3a5e42c1d0 |
User & Date: | mistachkin on 2016-10-28 04:53:04 |
Other Links: | manifest | tags |
Context
2016-10-28
| ||
04:59 | Add temporary directory cleanup block missing from the previous check-in. check-in: 1c31eb341e user: mistachkin tags: trunk | |
04:53 | Add support for automatically detecting the platform for a package to be downloaded. check-in: 6919e92033 user: mistachkin tags: trunk | |
02:15 | Allow the platform string 'neutral' to be used manually. check-in: 3dee9dc9c9 user: mistachkin tags: trunk | |
Changes
Modified client/1.0/neutral/pkgd.eagle from [63920e2496] to [b9b96e7274].
︙ | |||
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 | + + + + + + + + + + | # variable loginUrn; # DEFAULT: pkgd_login if {$force || ![info exists loginUrn]} then { set loginUrn pkgd_login } # # NOTE: The URN, relative to the base URI, where the list of supported # platforms for a single package may be found. # variable platformsUrn; # DEFAULT: pkgd_platforms if {$force || ![info exists platformsUrn]} then { set platformsUrn pkgd_platforms } # # NOTE: The URN, relative to the base URI, where a single package file # may be found. # variable downloadUrn; # DEFAULT: pkgd_file if {$force || ![info exists downloadUrn]} then { |
︙ | |||
81 82 83 84 85 86 87 88 89 90 91 92 93 94 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | + + + + + + + + + + | variable loginUri; # DEFAULT: ${baseUri}/${loginUrn}?... if {$force || ![info exists loginUri]} then { set loginUri [appendArgs \ {${baseUri}/${loginUrn}?} {[uriEscape name $userName]} & \ {[uriEscape password $password]}] } # # NOTE: The URI where the list of supported platforms for a single # package may be found. # variable platformsUri; # DEFAULT: ${baseUri}/${platformsUrn}?... if {$force || ![info exists platformsUri]} then { set platformsUri {${baseUri}/${platformsUrn}?download&name=trunk} } # # NOTE: The URI where a single package file may be found. This file will # belong to a specific version of one package. # variable downloadUri; # DEFAULT: ${baseUri}/${downloadUrn}?... |
︙ | |||
389 390 391 392 393 394 395 | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 | - + | proc isOpenPgpSignatureFileName { fileName nameOnly } { if {[string length $fileName] == 0} then { return false } set extension [file extension $fileName] |
︙ | |||
634 635 636 637 638 639 640 641 642 643 644 645 | 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 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 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + | set isClient true } else { error "unsupported language" } } # # NOTE: This procedure returns the name of the current platform. There are # no arguments. An empty string will be returned if the name of the # current platform cannot be determined for any reason. # proc getPlatform {} { global tcl_platform if {[info exists tcl_platform(platform)]} then { set platform $tcl_platform(platform) if {[info exists tcl_platform(machine)]} then { set machine $tcl_platform(machine) } else { set machine "" } switch -exact -- $platform { windows { switch -exact -- $machine { intel - ia32_on_win64 { return win32-x86 } arm { return win32-arm } ia64 { return win64-ia64 } amd64 { return win64-x64 } arm64 { return win64-arm64 } } } } } 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 |
︙ | |||
932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 | 1054 1055 1056 1057 1058 1059 1060 1061 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 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 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 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + | } else { file delete -force -- $temporaryDirectory } return [expr {$compare > 0}] } # # 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 # language is either "eagle" or "client". The packageName argument # is a directory name relative to the language and version-specific # directory on the package file server and may be an empty string. # The localFileName argument is the file name where the downloaded # file should be written. The usePgp argument should be non-zero # when an OpenPGP signature needs to be verified for the downloaded # file. # proc downloadAllPlatforms { language version packageName usePgp } { variable baseUri variable platformsUri variable platformsUrn variable temporaryRootDirectory set temporaryDirectory [file join \ $temporaryRootDirectory [appendArgs \ pkgd_plat_ [::PackageRepository::getUniqueSuffix]]] set localFileName [file join $temporaryDirectory manifest.txt] file mkdir [file dirname $localFileName] # # NOTE: First, build the final URI to download from the remote package # repository. # 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] # # 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. # 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] # # NOTE: Read the (OpenPGP verified) Fossil manifest data from the local # file and split it into lines. # set data [readFile $localFileName]; set lines [split $data \n] foreach line $lines { if {[string range $line 0 1] eq "F "} then { set fileName [lindex [split $line " "] 1] if {[string match [file join \ $language $version * $packageName *] $fileName]} then { set directory [lindex [file split $fileName] 2] if {[string length $directory] > 0} then { lappend platforms $directory } } } } return [lsort -unique $platforms] } # # 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 # 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 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 package does not require a specific # platform. The fileName argument is a file name relative to the # language and version-specific directory on the package file server. # The localFileName argument is the file name where the downloaded # file should be written. The usePgp argument should be non-zero when |
︙ |
Modified client/1.0/neutral/pkgd.eagle.asc from [5aece71259] to [a4a5c1129d].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - - - - - - - - - - - - - + + + + + + + + + + + + + | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository |
Modified client/1.0/neutral/pkgd.eagle.harpy from [62b4c2cc70] to [02d7425114].
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 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 58 59 60 61 62 63 64 65 66 67 68 | - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | THE ASSOCIATED SOFTWARE MAY NOT WORK PROPERLY IF THIS FILE IS ALTERED. --> <Certificate xmlns="https://eagle.to/2011/harpy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Protocol>None</Protocol> <Vendor>Mistachkin Systems</Vendor> |
Modified client/1.0/neutral/pkgd.eagle.harpy.asc from [cf7bbc4a40] to [bd034e58a0].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - - - - - - - - - - - - - + + + + + + + + + + + + + | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository |
Modified client/1.0/neutral/pkgr.eagle from [2390687eb3] to [132b4f6495].
︙ | |||
1596 1597 1598 1599 1600 1601 1602 | 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 | + + + + + + + + - + | global tcl_platform if {[string length $script] == 0 || \ ![file exists $script] || ![file isfile $script]} then { return } set prefixes [list] if {[info exists tcl_platform(user)]} then { lappend prefixes $tcl_platform(user) } lappend prefixes "" |
︙ |
Modified client/1.0/neutral/pkgr.eagle.asc from [d00499e8ad] to [600e52e963].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - - - - - - - - - - - - - + + + + + + + + + + + + + | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository |
Modified client/1.0/neutral/pkgr.eagle.harpy from [ba9aae3011] to [2280aea880].
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 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 58 59 60 61 62 63 64 65 66 67 68 | - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | THE ASSOCIATED SOFTWARE MAY NOT WORK PROPERLY IF THIS FILE IS ALTERED. --> <Certificate xmlns="https://eagle.to/2011/harpy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Protocol>None</Protocol> <Vendor>Mistachkin Systems</Vendor> |
Modified client/1.0/neutral/pkgr.eagle.harpy.asc from [83b3014d91] to [d96d71386d].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - - - - - - - - - - - - - + + + + + + + + + + + + + | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository |