From: Andrey Volk Date: Wed, 7 Dec 2022 20:31:51 +0000 (+0300) Subject: [Build-System] Improve build time on Windows: Do not download a pre-compiled binary... X-Git-Tag: v1.10.9^2~16^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1889%2Fhead;p=thirdparty%2Ffreeswitch.git [Build-System] Improve build time on Windows: Do not download a pre-compiled binary if it's found in a folder pointed by the FreeSWITCHBuildCachePath environment variable. --- diff --git a/w32/downloadpackage.task b/w32/downloadpackage.task index 0c7081a0fb..ef5322cfd7 100644 --- a/w32/downloadpackage.task +++ b/w32/downloadpackage.task @@ -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