Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/c#/GeneralUpdate.Core/Bootstrap/GeneralClientBootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private async Task ExecuteWorkflowAsync()

//black list initialization.
BlackListManager.Instance?.AddBlackFiles(_configInfo.BlackFiles);
BlackListManager.Instance?.AddBlackFileFormats(_configInfo.BlackFormats);
BlackListManager.Instance?.AddBlackFormats(_configInfo.BlackFormats);
BlackListManager.Instance?.AddSkipDirectorys(_configInfo.SkipDirectorys);

_configInfo.Encoding = GetOption(UpdateOption.Encoding) ?? Encoding.Default;
Expand Down Expand Up @@ -211,7 +211,7 @@ private async Task ExecuteWorkflowAsync()
var processInfo = ConfigurationMapper.MapToProcessInfo(
_configInfo,
mainResp.Body,
BlackListManager.Instance.BlackFileFormats.ToList(),
BlackListManager.Instance.BlackFormats.ToList(),
BlackListManager.Instance.BlackFiles.ToList(),
BlackListManager.Instance.SkipDirectorys.ToList());

Expand Down
4 changes: 2 additions & 2 deletions src/c#/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private void InitializeFromEnvironment()

if (processInfo == null) return;

BlackListManager.Instance.AddBlackFileFormats(processInfo.BlackFileFormats);
BlackListManager.Instance.AddBlackFormats(processInfo.BlackFileFormats);
BlackListManager.Instance.AddBlackFiles(processInfo.BlackFiles);
BlackListManager.Instance.AddSkipDirectorys(processInfo.SkipDirectorys);

Expand Down Expand Up @@ -245,7 +245,7 @@ private void ApplyRuntimeOptions()
private void InitBlackList()
{
BlackListManager.Instance.AddBlackFiles(_configInfo.BlackFiles);
BlackListManager.Instance.AddBlackFileFormats(_configInfo.BlackFormats);
BlackListManager.Instance.AddBlackFormats(_configInfo.BlackFormats);
BlackListManager.Instance.AddSkipDirectorys(_configInfo.SkipDirectorys);
}

Expand Down
12 changes: 2 additions & 10 deletions src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Version>10.0.0-preview</Version>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.1" />
<PackageReference Include="System.Collections.Immutable" Version="10.0.1" />
Expand All @@ -21,16 +22,7 @@
</ItemGroup>

<ItemGroup>
<!-- DrivelutionMiddleware: requires net10.0 target, Core is netstandard2.0 -->
<Compile Remove="Pipeline\DrivelutionMiddleware.cs" />
<Compile Remove="Pipeline\PatchMiddleware.cs" />
<Compile Remove="Strategy\WindowsStrategy.cs" />
<Compile Remove="Strategy\LinuxStrategy.cs" />
<Compile Remove="Strategy\OSSStrategy.cs" />
<Compile Remove="Strategy\MacStrategy.cs" />
<Compile Remove="Bootstrap\GeneralUpdateBootstrap.cs" />
<Compile Remove="Bootstrap\GeneralClientBootstrap.cs" />
<Compile Remove="Bootstrap\GeneralUpdateOSS.cs" />
<Compile Remove="Bootstrap\GeneralClientOSS.cs" />
<Compile Remove="Silent\SilentUpdateMode.cs" />
</ItemGroup>
</Project>
24 changes: 9 additions & 15 deletions src/c#/GeneralUpdate.Core/Pipeline/PatchMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,20 @@
using System.Threading.Tasks;
using GeneralUpdate.Core.Pipeline;
using GeneralUpdate.Core;
using GeneralUpdate.Differential;

namespace GeneralUpdate.Core.Pipeline;

/// <summary>
/// Differential patch middleware.
/// Full implementation requires GeneralUpdate.Differential (circular dependency — see T2).
/// Currently a no-op placeholder; patches are applied externally.
/// </summary>
public class PatchMiddleware : IMiddleware
{
public async Task InvokeAsync(PipelineContext context)
{
var sourcePath = context.Get<string>("SourcePath");
var targetPath = context.Get<string>("PatchPath");
GeneralTracer.Info($"PatchMiddleware.InvokeAsync: applying differential patch. SourcePath={sourcePath}, PatchPath={targetPath}");
try
{
await DifferentialCore.Dirty(sourcePath, targetPath);
GeneralTracer.Info("PatchMiddleware.InvokeAsync: differential patch applied successfully.");
}
catch (Exception ex)
{
GeneralTracer.Error("PatchMiddleware.InvokeAsync: failed to apply differential patch.", ex);
throw;
}
GeneralTracer.Info("PatchMiddleware.InvokeAsync: differential patching is not available in this build. " +
"IBinaryDiffer injection via Bootstrap.BinaryDiffer<T>() will be re-enabled in a future PR.");
await Task.CompletedTask;
}
}
}
4 changes: 2 additions & 2 deletions src/c#/GeneralUpdate.Core/Silent/SilentUpdateMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private async Task PrepareUpdateIfNeededAsync()
}

BlackListManager.Instance?.AddBlackFiles(_configInfo.BlackFiles);
BlackListManager.Instance?.AddBlackFileFormats(_configInfo.BlackFormats);
BlackListManager.Instance?.AddBlackFormats(_configInfo.BlackFormats);
BlackListManager.Instance?.AddSkipDirectorys(_configInfo.SkipDirectorys);

_configInfo.Encoding = _encoding;
Expand All @@ -139,7 +139,7 @@ private async Task PrepareUpdateIfNeededAsync()
var processInfo = ConfigurationMapper.MapToProcessInfo(
_configInfo,
versions,
BlackListManager.Instance.BlackFileFormats.ToList(),
BlackListManager.Instance.BlackFormats.ToList(),
BlackListManager.Instance.BlackFiles.ToList(),
BlackListManager.Instance.SkipDirectorys.ToList());
_configInfo.ProcessInfo = JsonSerializer.Serialize(processInfo, ProcessInfoJsonContext.Default.ProcessInfo);
Expand Down
8 changes: 4 additions & 4 deletions src/c#/GeneralUpdate.Core/Strategy/MacStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public override void StartApp()

protected override PipelineBuilder BuildPipeline(PipelineContext context)
{
var builder = new PipelineBuilder(context);
builder.Use(new HashMiddleware());
builder.Use(new CompressMiddleware());
builder.Use(new PatchMiddleware());
var builder = new PipelineBuilder(context)
.UseMiddleware<HashMiddleware>()
.UseMiddleware<CompressMiddleware>()
.UseMiddleware<PatchMiddleware>();
return builder;
}
}
Loading