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