Files
nixpkgs/pkgs/by-name/am/amber-lang/fix_gnused_detection.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

30 lines
1.3 KiB
Diff

From cae2ad70d6202bc97623be8c7c123ee2736a4644 Mon Sep 17 00:00:00 2001
From: aleksana <me@aleksana.moe>
Date: Sun, 9 Mar 2025 21:19:27 +0800
Subject: [PATCH] replace_regex: remove bash word boundary when detecting
gnused
Bash linked against C libraries other than GLibc may not support GNU
extensions of POSIX Extended Regular Regex. For example,
> re='\bx'; [[ 'x' =~ $re ]] && echo "1"
does not output the same result on Linux/GLibc and macOS.
---
src/std/text.ab | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/std/text.ab b/src/std/text.ab
index fe071e33..82449a02 100644
--- a/src/std/text.ab
+++ b/src/std/text.ab
@@ -19,7 +19,7 @@ pub fun replace_regex(source: Text, search: Text, replace: Text, extended: Bool
// GNU sed versions 4.0 through 4.2 support extended regex syntax,
// but only via the "-r" option; use that if the version information
// contains "GNU sed".
- $ re='\bCopyright\b.+\bFree Software Foundation\b'; [[ \$(sed --version 2>/dev/null) =~ \$re ]] $
+ $ re='Copyright.+Free Software Foundation'; [[ \$(sed --version 2>/dev/null) =~ \$re ]] $
let flag = status == 0 then "-r" else "-E"
return $ echo "{source}" | sed "{flag}" -e "s/{search}/{replace}/g" $
} else {