[Bug 254367] etcupdate status should exit with rc != 0 whenever there is one or more conflicts
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Mar 17 20:14:16 UTC 2021
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254367
Bug ID: 254367
Summary: etcupdate status should exit with rc != 0 whenever
there is one or more conflicts
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: bugs at FreeBSD.org
Reporter: Trond.Endrestol at ximalas.info
On a test VM running 13.0-CURRENT with the source tree fully updated, coming
from Subversion, I ran:
# etcupdate extract
# etcupdate -p
# etcupdate
So far, so good. The running system was also updated to the last Subversion
commit for base/head.
I then prepared 14.0-CURRENT with the source tree this time coming from Git,
branch main, and I ran:
# etcupdate extract
# etcupdate -p
<Output omitted>
# etcupdate
<Lots and lots of output omitted>
# etcupdate status && echo All is OK
C /etc/newsyslog.conf.d/lpr.conf
C /etc/newsyslog.conf.d/pf.conf
C /etc/newsyslog.conf.d/ppp.conf
C /etc/newsyslog.conf.d/ftp.conf
All is OK
# etcupdate resolve
<Choose e for edit, edit to your heart's content, save and exit, choose r to
mark as resolved, and rinse and repeat for the remaining files.>
# etcupdate status && echo All is OK
All is OK
In my opinion, "etcupdate status" should not exit with rc = 0 when there is one
or more unresolved conflicts present. This follows from the manpage, "The
etcupdate utililty exits 0 on success, and >0 if an error occurs.", and also
from a desire to use etcupdate(8) in a shell script like this:
etcupdate -p
etcupdate resolve -p
etcupdate
etcupdate resolve
while ! etcupdate status; do
etcupdate resolve
done
A workaround is to use the condition: ! etcupdate status | grep -q '^ C'
I guess it's up to interpretation on whether conflicts of this nature should be
regarded as errors. I appreciate all feedback on the matter.
Also, could we have "etcupdate status -p" too?
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list