]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Minor enhancements to the TclKit download tool.
authormistachkin <mistachkin@noemail.net>
Mon, 25 Nov 2019 00:07:03 +0000 (00:07 +0000)
committermistachkin <mistachkin@noemail.net>
Mon, 25 Nov 2019 00:07:03 +0000 (00:07 +0000)
FossilOrigin-Name: 75e31b1d56781fc4d28aea6c7f1393a18fd34870a5beb92df81c088d61351b4a

manifest
manifest.uuid
tool/GetFile.cs

index 70c5fd08abfc35afbe728ddb8da7a0b6ca5a10be..1209d288043949588b10db6c5f6e5d7ba6f56cdf 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Abort\sthe\swindow\sfunction\stree\srewrite\searly\sfollowing\san\sOOM.
-D 2019-11-23T16:34:40.792
+C Minor\senhancements\sto\sthe\sTclKit\sdownload\stool.
+D 2019-11-25T00:07:03.727
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -1750,7 +1750,7 @@ F test/zerodamage.test 9c41628db7e8d9e8a0181e59ea5f189df311a9f6ce99cc376dc461f66
 F test/zipfile.test b3b558639f7a103e095713ad0f57fec1fce1b7d60c8054df5789b98f7547a395
 F test/zipfile2.test 9903388a602a3834189857a985106ff95c3bba6a3969e0134127df991889db5d
 F test/zipfilefault.test 44d4d7a7f7cca7521d569d7f71026b241d65a6b1757aa409c1a168827edbbc2c
-F tool/GetFile.cs a15e08acb5dd7539b75ba23501581d7c2b462cb5
+F tool/GetFile.cs 47852aa0d806fe47ed1ac5138bdce7f000fe87aaa7f28107d0cb1e26682aeb44
 F tool/GetTclKit.bat 8995df40c4209808b31f24de0b58f90930239a234f7591e3675d45bfbb990c5d
 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91
 F tool/build-all-msvc.bat c12328d06c45fec8baada5949e3d5af54bf8c887 x
@@ -1851,7 +1851,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 57070c68bbe15fc1d19a765182432e844c082909bdbc63b58fd86b96e2c521dd
-R 5ec4b862f5e315c01dbee90c995a71d6
-U drh
-Z b069a61ef07a50420fc34a99d1dc8940
+P d66f95a51530259ab48f78c9f91acc38055caf338b6fee846b99a8c077466e95
+R d683a416a8082786a70e484e01bcd840
+U mistachkin
+Z b043cee0b36f72ca0ac332fc2e8f10e1
index 418e7ff21d7500e2026b1711c670e23ba4508e3d..3797136f4bf22d9caf9f88e7a09a987680493ec8 100644 (file)
@@ -1 +1 @@
-d66f95a51530259ab48f78c9f91acc38055caf338b6fee846b99a8c077466e95
\ No newline at end of file
+75e31b1d56781fc4d28aea6c7f1393a18fd34870a5beb92df81c088d61351b4a
\ No newline at end of file
index 56601f3e851e2006038620004fd3373cb76b1c86..1784a7926386bc37b82c54cba4dfe2974ad40c33 100644 (file)
@@ -167,7 +167,8 @@ namespace GetFile
             string fileName = Path.GetFileName(\r
                 Process.GetCurrentProcess().MainModule.FileName);\r
 \r
-            Console.WriteLine(String.Format("usage: {0} <uri>", fileName));\r
+            Console.WriteLine(String.Format(\r
+                "usage: {0} <uri> [fileName]", fileName));\r
         }\r
 \r
         ///////////////////////////////////////////////////////////////////////\r
@@ -336,7 +337,7 @@ namespace GetFile
                 return (int)ExitCode.MissingArgs;\r
             }\r
 \r
-            if (args.Length != 1)\r
+            if ((args.Length < 1) || (args.Length > 2))\r
             {\r
                 Error(null, true);\r
                 return (int)ExitCode.WrongNumArgs;\r
@@ -355,15 +356,26 @@ namespace GetFile
             }\r
 \r
             //\r
-            // NOTE: Attempt to extract the file name portion of the URI we\r
-            //       just created.\r
+            // NOTE: If a file name was specified on the command line, try to\r
+            //       use it (without its directory name); otherwise, fallback\r
+            //       to using the file name portion of the URI.\r
             //\r
-            string fileName = GetFileName(uri);\r
+            string fileName = (args.Length == 2) ?\r
+                Path.GetFileName(args[1]) : null;\r
 \r
-            if (fileName == null)\r
+            if (String.IsNullOrEmpty(fileName))\r
             {\r
-                Error("Could not extract the file name from the URI.", false);\r
-                return (int)ExitCode.BadFileName;\r
+                //\r
+                // NOTE: Attempt to extract the file name portion of the URI\r
+                //       we just created.\r
+                //\r
+                fileName = GetFileName(uri);\r
+\r
+                if (fileName == null)\r
+                {\r
+                    Error("Could not extract file name from URI.", false);\r
+                    return (int)ExitCode.BadFileName;\r
+                }\r
             }\r
 \r
             //\r
@@ -381,6 +393,15 @@ namespace GetFile
 \r
             try\r
             {\r
+                //\r
+                // HACK: For use of the TLS 1.2 security protocol because some\r
+                //       web servers fail without it.  In order to support the\r
+                //       .NET Framework 2.0+ at compilation time, must use its\r
+                //       integer constant here.\r
+                //\r
+                ServicePointManager.SecurityProtocol =\r
+                    (SecurityProtocolType)0xC00;\r
+\r
                 using (WebClient webClient = new WebClient())\r
                 {\r
                     //\r