Skip to content

Commit a8dfcd2

Browse files
committed
Restore libyaml changes
1 parent a7a6731 commit a8dfcd2

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

src/VcpkgPortOverlay/CreatePortOverlay.ps1

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,28 @@ function Update-PortSource
280280

281281
$portDir = Join-Path $OverlayRoot $Port
282282

283-
Set-ParameterInPortFile $Port -ParameterName 'REF' -CurrentValuePattern '[0-9a-f]{40}' -NewValue $Commit
283+
# For the REF, we also delete any comments after it that may say the wrong version
284+
Set-ParameterInPortFile $Port -ParameterName 'REF' -CurrentValuePattern '[0-9a-f]{40}( #.*)?$' -NewValue "$Commit # Unreleased"
284285
Set-ParameterInPortFile $Port -ParameterName 'SHA512' -CurrentValuePattern '[0-9a-f]{128}' -NewValue $SourceHash
285286
}
286287

288+
# Updates the port version by one.
289+
function Update-PortVersion
290+
{
291+
param(
292+
[Parameter(Mandatory)]
293+
[string]$Port
294+
)
295+
296+
$portJsonPath = Join-Path $OverlayRoot $Port "vcpkg.json"
297+
$portDefinition = Get-Content $portJsonPath | ConvertFrom-Json
298+
$portDefinition."port-version" += 1
299+
$portDefinition | ConvertTo-Json -Depth 5 | Out-File $portJsonPath
300+
}
301+
287302
New-PortOverlay cpprestsdk -Version 2.10.18 -PortVersion 4
288303
Add-PatchToPort cpprestsdk -PatchRepo 'microsoft/winget-cli' -PatchCommit '888b4ed8f4f7d25cb05a47210e083fe29348163b' -PatchName 'add-server-certificate-validation.patch' -PatchRoot 'src/cpprestsdk/cpprestsdk'
289304

290305
New-PortOverlay libyaml -Version 0.2.5 -PortVersion 5
291306
Update-PortSource libyaml -Commit '840b65c40675e2d06bf40405ad3f12dec7f35923' -SourceHash 'de85560312d53a007a2ddf1fe403676bbd34620480b1ba446b8c16bb366524ba7a6ed08f6316dd783bf980d9e26603a9efc82f134eb0235917b3be1d3eb4b302'
307+
Update-PortVersion libyaml

src/VcpkgPortOverlay/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ Changes:
1919
We use an unreleased version that fixes a vulnerability.
2020

2121
Changes:
22-
* New source commit: https://github.com/yaml/libyaml/commit/840b65c40675e2d06bf40405ad3f12dec7f35923
22+
* New source commit: https://github.com/yaml/libyaml/commit/840b65c40675e2d06bf40405ad3f12dec7f35923
23+
* Increase the port version so that Component Governance doesn't see it as the vulnerable version anymore

src/VcpkgPortOverlay/libyaml/portfile.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ endif()
55
vcpkg_from_github(
66
OUT_SOURCE_PATH SOURCE_PATH
77
REPO yaml/libyaml
8-
REF 840b65c40675e2d06bf40405ad3f12dec7f35923 # 0.2.5
8+
REF 840b65c40675e2d06bf40405ad3f12dec7f35923 # Unreleased
99
SHA512 de85560312d53a007a2ddf1fe403676bbd34620480b1ba446b8c16bb366524ba7a6ed08f6316dd783bf980d9e26603a9efc82f134eb0235917b3be1d3eb4b302
1010
HEAD_REF master
1111
PATCHES

src/VcpkgPortOverlay/libyaml/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "libyaml",
33
"version": "0.2.5",
4-
"port-version": 5,
4+
"port-version": 6,
55
"description": "A C library for parsing and emitting YAML.",
66
"homepage": "https://github.com/yaml/libyaml",
77
"dependencies": [

0 commit comments

Comments
 (0)