[Bug 279200] sysrc(8) fails to perform set operations for += and -= in -c (check only) mode.

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 14 Apr 2025 07:21:20 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279200

--- Comment #2 from Michal Scigocki <michal.os@hotmail.com> ---
I had a look, and it looks like the check logic does not account for APPEND and
SUBTRACT operations. It just compares the existing value in the rc.conf file(s)
to the value of the variable supplied on the command line.

The APPEND/SUBTRACT logic does peform the union/difference calculation. The
check logic can be moved after the APPEND/SUBTRACT logic, and use the "before"
and "new" variables for the check comparison to get the correct result.

I have created some regression tests for sysrc and a patch for this problem,
and made a pull request with the the changes to github:
https://github.com/freebsd/freebsd-src/pull/1664

-- 
You are receiving this mail because:
You are the assignee for the bug.