private bool CompareComponentVersion(string componentId, string versionSrc, VersionRelation relation) { var component = CurrentlyInstalledComponents .FirstOrDefault(x => x.ComponentId == componentId); if (component == null) { throw new PatchExecutionException( RepositoryIsRunning ? PatchExecutionErrorType.ExecutionErrorOnBefore : PatchExecutionErrorType.ExecutionErrorOnAfter, CurrentPatch, "Component not found: " + componentId); } var version = PatchBuilder.ParseVersion(versionSrc, CurrentPatch); var componentVersion = RepositoryIsRunning ? component.TempVersionAfter ?? component.Version : component.TempVersionBefore ?? component.Version; switch (relation) { case VersionRelation.LowerOrEqual: return(version >= componentVersion); case VersionRelation.Lower: return(version > componentVersion); case VersionRelation.Equal: return(version == componentVersion); case VersionRelation.Higher: return(version < componentVersion); case VersionRelation.HigherOrEqual: return(version <= componentVersion); default: throw new ArgumentOutOfRangeException(nameof(relation), relation, null); } }
internal ItemBuilder(SnPatchBase patch, PatchBuilder patchBuilder) { _patch = patch; _patchBuilder = patchBuilder; }
public DependencyBuilder(PatchBuilder patchBuilder) { _patchBuilder = patchBuilder; }
internal PatchBuilderAfterAction(SnPatchBase patch, PatchBuilder patchBuilder) { _patch = patch; _patchBuilder = patchBuilder; }