git: 1c0a8f34bb05 - main - security/acme.sh: Apply upstream patch for tr

From: Dan Langille <dvl_at_FreeBSD.org>
Date: Mon, 22 Sep 2025 11:42:20 UTC
The branch main has been updated by dvl:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1c0a8f34bb0558176e91835f88d1733e3c4d5ee3

commit 1c0a8f34bb0558176e91835f88d1733e3c4d5ee3
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2025-09-22 11:40:46 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2025-09-22 11:42:18 +0000

    security/acme.sh: Apply upstream patch for tr
    
    This fixes a change to "tr a-z A-Z" behaviour that appeared in
    FreeBSD 11.*, causing tr to output unexpected garbage, not
    uppercasing a string.
    
    re: * https://github.com/acmesh-official/acme.sh/issues/6511#issuecomment-3282521860
        * https://github.com/acmesh-official/acme.sh/commit/a1ea2a5aa6a63c1c99daffc66c1463e3a2ac88ab
    
    PR:             289444
---
 security/acme.sh/Makefile            |  1 +
 security/acme.sh/files/patch-acme.sh | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/security/acme.sh/Makefile b/security/acme.sh/Makefile
index e5ad098963d2..c36e819d362f 100644
--- a/security/acme.sh/Makefile
+++ b/security/acme.sh/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	acme.sh
 PORTVERSION=	3.1.1
+PORTREVISION=	1	
 CATEGORIES=	security
 
 MAINTAINER=	dvl@FreeBSD.org
diff --git a/security/acme.sh/files/patch-acme.sh b/security/acme.sh/files/patch-acme.sh
new file mode 100644
index 000000000000..e21b8561a5dc
--- /dev/null
+++ b/security/acme.sh/files/patch-acme.sh
@@ -0,0 +1,36 @@
+diff --git acme.sh acme.sh
+index 3316b25fa9..02986a332d 100755
+--- acme.sh
++++ acme.sh
+@@ -436,14 +436,28 @@ _secure_debug3() {
+   fi
+ }
+ 
++__USE_TR_TAG=""
++if [ "$(echo "abc" | LANG=C tr a-z A-Z 2>/dev/null)" != "ABC" ] ; then
++  __USE_TR_TAG="1"
++fi
++export __USE_TR_TAG
++
+ _upper_case() {
++  if [ "$__USE_TR_TAG" ]; then
++    LANG=C tr '[:lower:]' '[:upper:]'
++  else
+   # shellcheck disable=SC2018,SC2019
+-  tr '[a-z]' '[A-Z]'
++    LANG=C tr '[a-z]' '[A-Z]'
++  fi
+ }
+ 
+ _lower_case() {
+-  # shellcheck disable=SC2018,SC2019
+-  tr '[A-Z]' '[a-z]'
++  if [ "$__USE_TR_TAG" ]; then
++    LANG=C tr '[:upper:]' '[:lower:]'
++  else
++    # shellcheck disable=SC2018,SC2019
++    LANG=C tr '[A-Z]' '[a-z]'
++  fi
+ }
+ 
+ _startswith() {