https://github.com/freebsd/freebsd-ports/commit/beb96db3cafbf2f65508e09de788a93839060dc2#diff-decc86480f366f42157f70acd9c461d0a1ce822ca3733426f9e0b4e8fab03293R6 contains a shell syntax error. When upgrading security/acme.sh on my various jails, the acme.sh pkg-install script errored with: [car.popho.be] [18/22] Extracting acme.sh-3.0.6_1: 100% [: !-f: unexpected operator The correct line should be: if [ ! -f /var/log/acme.sh.log ]
that whole script is not pkg -r safe, and i have no idea how to make it safe without converting it to pkg-lua-script(5)
looking at the code, cuz i couldn't find any docs, it looks like we should use ${PKG_ROOTDIR}${PKG_PREFIX} instead of of /usr/local. and i think /usr/bin/install can stay the way it is, since it's not a binary that needs to be of a certain ABI for this operation to succeed
(In reply to Mina Galić from comment #2) Where you do see /usr/local used? Apart from here? [11:50 pkg01 dan ~/ports/head/security/acme.sh] % grep -r /usr/local * files/acme-crontab.in:# This file should be copied to /usr/local/etc/cron.d/acme
(In reply to Moviuro from comment #0) Thank you for this report. I have failed in the past to see this message but I am able to reproduce it via 'poudriere testport'. While fixing the error, I will also rename pkg-install to pkg-post-install re https://docs.freebsd.org/en/books/porters-handbook/pkg-files/#pkg-install This also means the POST-INSTALL check can be removed from that file.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=678db807ed62622394f5ce17b7e492a300d10043 commit 678db807ed62622394f5ce17b7e492a300d10043 Author: Dan Langille <dvl@FreeBSD.org> AuthorDate: 2023-10-08 12:22:15 +0000 Commit: Dan Langille <dvl@FreeBSD.org> CommitDate: 2023-10-08 12:25:19 +0000 security/acme.sh: fix post-install script The install script contained a syntax error which caused the log file to not be created. While here: * rename script from pkg-install to pkg-post-install * include another crontab example which provides additional contet to logging. PR: 274348 security/acme.sh/Makefile | 1 + security/acme.sh/files/acme-crontab.in | 24 +++++++++++++++++++++--- security/acme.sh/pkg-install (gone) | 11 ----------- security/acme.sh/pkg-post-install (new) | 7 +++++++ 4 files changed, 29 insertions(+), 14 deletions(-)
Leaving this open pending further reports re /usr/local
With no further replies, closing.