rubber always returns true

Bug #412465 reported by Michael Schnupp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rubber
Confirmed
Low
Unassigned
rubber (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: rubber

rubber should return a different exit value, depending on whether it had to modify the output file.

After printing a "nothing to be done for $target" it should return false, allowing for example shell scripts or make files to easily decide if further action is required.

Changed in rubber:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Paul Kishimoto (khaeru)
milestone: none → 1.2
Changed in rubber (Ubuntu):
status: New → Confirmed
Revision history for this message
Emmanuel Beffara (manu-beffara) wrote :

Hi,

Currently, rubber returns false if some processing failed, and true if everything went fine. This is standard behaviour: not doing anything because the output document is up to date is not a failure. I do think it is the way it should be.

I admit that it might be useful in some situations to detect if some processing was actually performed. However, I don't know of a standard way for a command to return such information. It would be easy to add a command-line switch so that false is returned when nothing was done, but then how could one distinguish that from an actual failure?

Emmanuel

Revision history for this message
Michael Schnupp (michas) wrote :

Maybe "nothing to be done" could be interpreted as a special kind of error. (i.e. another return value)
Like "yes, I build a new document as you changed the source" and "no, I didn't build it, as there is nothing to do" and "no, I couldn't build it as there was some kind of error.".

But for me it was more a whishlist item, as it seemed as the return value is actually not used and simply always returns true.

Changed in rubber:
assignee: Paul Kishimoto (khaeru) → nobody
Revision history for this message
Alex Hirzel (alhirzel) wrote :

gmake has a -q/--question flag that will determine if a rebuild is necessary but not perform it. pmake does not have a similar behavior. I propose we adopt the --question flag with the following behavior:

If any output files would be rebuilt return 1, else return 0.

This covers all use cases that come to my mind. It also avoids overloading the return value heavily.

Revision history for this message
Sebastian Kapfer (caci) wrote :

A --query flag sounds like a good solution. Patches welcome!

Changed in rubber:
importance: Medium → Low
milestone: 1.2 → 1.3
Sebastian Kapfer (caci)
Changed in rubber:
milestone: 1.3 → 1.4
Sebastian Kapfer (caci)
Changed in rubber:
milestone: 1.4 → none
milestone: none → 1.5
Changed in rubber:
milestone: 1.5 → none
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.