Skip to content

Commit 2e15c0c

Browse files
bezzadclaude
andcommitted
fix(test): CRLF-proof the AUR packaging guard on Windows CI
git's autocrlf checkout gave PKGBUILD/.SRCINFO CRLF endings on the Windows runners, so the $-anchored pkgver regex failed ("PKGBUILD must declare a semver pkgver"). Normalize \r in the test and pin packaging/aur/* to LF via .gitattributes — makepkg/bash need LF there regardless. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GpEAzmp4bQ5LDSW5ucuXk7
1 parent 682b181 commit 2e15c0c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packaging/aur/* text eol=lf

src/Downloader.Desktop.Tests/Unit/AurPackagingTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ public class AurPackagingTests
1515
[Fact(Timeout = TestTimeouts.DefaultMs)]
1616
public void Pkgbuild_and_srcinfo_are_publish_ready_and_in_lockstep()
1717
{
18-
var pkgbuild = File.ReadAllText(FindRepoFile(Path.Combine("packaging", "aur", "PKGBUILD")));
19-
var srcinfo = File.ReadAllText(FindRepoFile(Path.Combine("packaging", "aur", ".SRCINFO")));
18+
// Normalize CRLF: a Windows git checkout (autocrlf) otherwise breaks the $-anchored matches.
19+
var pkgbuild = File.ReadAllText(FindRepoFile(Path.Combine("packaging", "aur", "PKGBUILD"))).Replace("\r", "");
20+
var srcinfo = File.ReadAllText(FindRepoFile(Path.Combine("packaging", "aur", ".SRCINFO"))).Replace("\r", "");
2021

2122
var pkgVer = Regex.Match(pkgbuild, @"^pkgver=([0-9]+\.[0-9]+\.[0-9]+)$", RegexOptions.Multiline);
2223
Assert.True(pkgVer.Success, "PKGBUILD must declare a semver pkgver");

0 commit comments

Comments
 (0)