Overview
Comment: | Fix platform detection for neutral packages in the downloader. Verify that OpenPGP is installed prior to calling it. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
5652e4cf004d73a17ec86a5b78dcf0b9 |
User & Date: | mistachkin on 2016-10-31 00:39:38 |
Other Links: | manifest | tags |
Context
2016-10-31
| ||
01:19 | Remove some duplicated code. Reorganize some code. check-in: 6a05f4832c user: mistachkin tags: trunk | |
00:39 | Fix platform detection for neutral packages in the downloader. Verify that OpenPGP is installed prior to calling it. check-in: 5652e4cf00 user: mistachkin tags: trunk | |
2016-10-28
| ||
20:59 | Fix URI query parameter escaping when evaluated in Eagle. check-in: ca8bb45c5e user: mistachkin tags: trunk | |
Changes
Modified client/1.0/neutral/pkgd.eagle from [a3005634bc] to [9ace2abafb].
︙ | |||
698 699 700 701 702 703 704 705 706 707 708 709 710 711 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } } } 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 |
︙ | |||
740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 | 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 | + + + + + + + + - + | upvar 1 packageName packageName if {[info exists packageName]} then { set localPackageName $packageName } else { set localPackageName "" } upvar 1 fileNames fileNames if {[info exists fileNames]} then { set localFileNames $fileNames } else { set localFileNames [list] } upvar 1 usePgp usePgp if {[info exists usePgp]} then { set localUsePgp $usePgp } else { set localUsePgp false } # # NOTE: Download the list of platforms associated with this package # from the package repository server. This may fail and raise # a script error. # set platforms [downloadAllPlatforms \ |
︙ | |||
1064 1065 1066 1067 1068 1069 1070 | 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 | - - - + + + - - + | # 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. |
︙ | |||
1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 | 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 | + + | # 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 \"] } } # |
︙ | |||
1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 | 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 | + + + + | # # NOTE: Figure out the pattern to use when matching against the file # names in the manifest data. If available, this will include # the package name; otherwise, platform names for all packages # will be considered. # if {[string length $packageName] == 0} then { set packageName [guessPackageNameFromFileNames $language $fileNames] } if {[string length $packageName] > 0} then { set pattern [file join $language $version * $packageName *] } else { set pattern [file join $language $version *] } foreach line $lines { |
︙ | |||
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 | 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 | + + | # 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 \"] } } } |
︙ |
Modified client/1.0/neutral/pkgd.eagle.asc from [00af33993b] to [17f1a65acf].
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 [96c6999702] to [8bbe23a216].
︙ | |||
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 [d35fbb9841] to [10600fc2ae].
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 [4bb89e0f4b] to [3456f0b008].
︙ | |||
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + | } incr counter } } } # # NOTE: This procedure attempts to verify that a configured implementation # of OpenPGP is installed locally. There are no arguments. Script # errors are raised if any problems are found. The return value is # undefined. # # <public> proc openPgpMustBeInstalled {} { variable openPgpInstalledCommand variable openPgpInstalledPattern if {[isEagle]} then { if {[catch { eval exec -success Success $openPgpInstalledCommand } result]} then { error "cannot use OpenPGP: may not be installed and/or configured" } } else { if {[catch { eval exec [subst $openPgpInstalledCommand] } result]} then { error "cannot use OpenPGP: may not be installed and/or configured" } } if {![info exists result] || \ ![regexp -- $openPgpInstalledPattern $result]} then { error "cannot use OpenPGP: unknown or unsupported version" } return "" } # # NOTE: This procedure attempts to verify the OpenPGP signature contained # in the specified (named) file. Non-zero is only returned if the # OpenPGP signature is verified successfully. A script error should # not be raised by this procedure. The fileName argument must be # the fully qualified path and file name of the OpenPGP signature # file to verify. # # <public> proc verifyOpenPgpSignature { fileName } { |
︙ | |||
1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 | 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 | + + | writeFile $fileName(2) $metadata(certificate) } # # NOTE: Attempt to verify the OpenPGP signature for the package # script. # openPgpMustBeInstalled if {[verifyOpenPgpSignature $fileName(2)]} then { # # NOTE: Delete the temporary files that we created for the # OpenPGP signature verification. # eval $script(cleanup) } else { |
︙ | |||
1729 1730 1731 1732 1733 1734 1735 1736 1737 | 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 | + + + + + + + + + + + + + + + + + + + + + + - + + - + - - + + | [llength [package versions Garuda]] > 0} then { set autoRequireGaruda true } else { set autoRequireGaruda false } } # # NOTE: The command to use when attempting to verify that OpenPGP is # installed locally. This must be configured according to the # implementation of OpenPGP in use. # variable openPgpInstalledCommand; # DEFAULT: gpg2 --version if {![info exists openPgpInstalledCommand]} then { set openPgpInstalledCommand {gpg2 --version} } # # NOTE: The regular expression pattern used when attempting to verify # that OpenPGP is installed locally. This must be configured # according to the implementation of OpenPGP in use. # variable openPgpInstalledPattern; # DEFAULT: ^gpg \(GnuPG\) 2\.0\. if {![info exists openPgpInstalledPattern]} then { set openPgpInstalledPattern {^gpg \(GnuPG\) 2\.0\.} } # # NOTE: The command to use when verifying OpenPGP signatures for the |
︙ |
Modified client/1.0/neutral/pkgr.eagle.asc from [18ae0a6661] to [d1a4a2d2a1].
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 [ef5ccee09d] to [8d09927bd2].
︙ | |||
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 [befd86834b] to [7b17706134].
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 |