]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Build-System] Improve build time on Windows: Do not download a pre-compiled binary... 1889/head
authorAndrey Volk <andywolk@gmail.com>
Wed, 7 Dec 2022 20:31:51 +0000 (23:31 +0300)
committerAndrey Volk <andywolk@gmail.com>
Wed, 7 Dec 2022 21:02:12 +0000 (15:02 -0600)
w32/downloadpackage.task

index 0c7081a0fba4b192d600aa4c39f7acaba8bd081d..ef5322cfd71d39b67eee5c0ed2f901d1157d3cb2 100644 (file)
@@ -100,7 +100,14 @@ using System.Diagnostics;
                     Uri uri = new Uri(package);
                     string urifilename = Path.GetFileName(uri.LocalPath);
                     string output = Path.Combine(outputfolder ?? librarypath, (outputfilename ?? urifilename));
-
+                    string cachedir = Environment.GetEnvironmentVariable("FreeSWITCHBuildCachePath") ?? "";
+                    string cached_file = cachedir != "" ? Path.Combine(cachedir, (outputfilename ?? urifilename)) : "";
+
+                    if (cached_file != "" && File.Exists(cached_file)) {
+                        Log.LogMessage(MessageImportance.High,
+                                            "Found package in cache \"" + cached_file + "\".");
+                        File.Copy(cached_file, output); 
+                    } else
                     //if (!File.Exists(output)) // Uncomment to skip download if exists
                     {
                         var syncObject = new State