Doing `etcupdate -n` itself runs OK, but following `etcupdate -B` does NOT do anything, hence nothing is actually updated. The only workaround I have is NOT to try dry-run. This would be caused by any commit done in april 2021 on main (MFC'ed to stable/13 in june 2021). It would be because the same trees are used for dry-run and actual run. (Not looked into the code. Just a thought.) Maybe using dedicated trees (older one is copied from actual current one, building current tree on dedicated place and delete them every time the dry-run finishes) for dry-run would fix. And copying /etc to some temporary place and applying changes to it, copy back to /etc may be help for your issue, I think.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=431944fb5ffff5ad56e720b75b7beecdc4878e0e commit 431944fb5ffff5ad56e720b75b7beecdc4878e0e Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-05-25 21:02:51 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-05-25 21:02:51 +0000 etcupdate: Don't rotate trees for a dry run. When performing a dry run, remove the temporary tree created rather than rotating the trees. Rotating the trees meant that etcupdate thought the latest changes were already merged and would not merge them on the next real run. PR: 260281 Reported by: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> Fixes: 0611aec3cf3a etcupdate: Always extract to a temporary tree. MFC after: 1 week usr.sbin/etcupdate/etcupdate.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+)
(In reply to commit-hook from comment #1) Thanks! Tried with several updates touching /etc on main and looks working fine. After the trial on main, manually cherry picked to stable13 and confirmed also works fine. Not tested on other branches as I don't have working environment. I'll close this once this is MFC'ed to stable13 and MFS'ed to releng13. (Not sure stable12 and releng12 are affected or not.) Sorry for the late answer as I had to confirm for multiple updates to be sure.
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5d7b7a98e5ed56a33bdafbeb57c2e85e0ae0aab5 commit 5d7b7a98e5ed56a33bdafbeb57c2e85e0ae0aab5 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-05-25 21:02:51 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-07-13 18:00:45 +0000 etcupdate: Don't rotate trees for a dry run. When performing a dry run, remove the temporary tree created rather than rotating the trees. Rotating the trees meant that etcupdate thought the latest changes were already merged and would not merge them on the next real run. PR: 260281 Reported by: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> Fixes: 0611aec3cf3a etcupdate: Always extract to a temporary tree. (cherry picked from commit 431944fb5ffff5ad56e720b75b7beecdc4878e0e) usr.sbin/etcupdate/etcupdate.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c4aa309d232cd1014e6eaae7043c29f8d45f5319 commit c4aa309d232cd1014e6eaae7043c29f8d45f5319 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-05-25 21:02:51 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-07-13 18:01:04 +0000 etcupdate: Don't rotate trees for a dry run. When performing a dry run, remove the temporary tree created rather than rotating the trees. Rotating the trees meant that etcupdate thought the latest changes were already merged and would not merge them on the next real run. PR: 260281 Reported by: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> Fixes: 0611aec3cf3a etcupdate: Always extract to a temporary tree. (cherry picked from commit 431944fb5ffff5ad56e720b75b7beecdc4878e0e) usr.sbin/etcupdate/etcupdate.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+)