Date: Wed, 17 Mar 2021 20:14:16 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 254367] etcupdate status should exit with rc != 0 whenever there is one or more conflicts Message-ID: <bug-254367-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254367 Bug ID: 254367 Summary: etcupdate status should exit with rc !=3D 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@FreeBSD.org Reporter: Trond.Endrestol@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 =3D 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 shoul= d be regarded as errors. I appreciate all feedback on the matter. Also, could we have "etcupdate status -p" too? --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-254367-227>