0 is returned when there is nothing to do

Bug #1595148 reported by Removed by request
6
Affects Status Importance Assigned to Milestone
binfmt-support (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'm using Ubuntu 16.10 dev with binfmt-support 2.1.6-1 and on trying to remove a non-existent entry from the database a warning is being displayed but 0 is returned like in this example:

root@ubuntu:~# update-binfmts --remove EXE /opt/wine-devel/bin/wine
update-binfmts: warning: /var/lib/binfmts/EXE does not exist; nothing to do!
root@ubuntu:~# echo $?
0

Additionally trying to add an entry twice for example with "update-binfmts --install EXE /opt/wine-devel/bin/wine --magic MZ" does not result in a warning that the entry already exists and 0 is returned too.

Revision history for this message
Colin Watson (cjwatson) wrote :

I don't think this is a bug. The principle I'm following here is that you asked update-binfmts to put your system into a certain state (respectively, "no binary format EXE should be installed" and "the binary format EXE should be installed with this specification"), and your system was already in that state, so it had nothing to do. Emitting a warning is reasonable in case this indicates a bug in something higher-level, but it is not a failure and a non-zero exit code would be inappropriate.

Could you explain why the zero exit code causes a problem for you?

Changed in binfmt-support (Ubuntu):
status: New → Incomplete
summary: - 0 is returned on failure
+ 0 is returned when there is nothing to do
Revision history for this message
Removed by request (removed3425744) wrote :

It doesn't cause a problem for me I just thought a non-zero exit code would be more appropriate on this warning but I'm fine if 0 is kept here. But what about adding an entry twice? Should there be a warning that this entry already exists and nothing is to do too?

Changed in binfmt-support (Ubuntu):
status: Incomplete → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.