GNOME Bugzilla – Bug 510651
Fix for 501066 broken when gtk-doc not installed`
Last modified: 2008-01-22 13:55:11 UTC
The fix for #501066 (commit 527) is broken when gtkdoc-rebase is not installed. http://svn.gnome.org/viewvc/gtk-doc?view=revision&revision=527 The problem is that running `which gtkdoc-rebase && do something with it' will return 1 if gtkdoc-rebase is not installed. Since this is the last command run in the shell that make spawns, the process will return 1 and make will fail. $ sh -c 'which gtkdoc-rebase >/dev/null 2>&1 && gtkdoc-rebase --version' $ echo $? 1 $ sh -c 'which gtkdoc-rebase >/dev/null 2>&1 && gtkdoc-rebase --version; true' $ echo $? 0 If you use an `if' statement with no else, though, it will return successfully if the condition isn't met. $ sh -c 'if which gtkdoc-rebase >/dev/null 2>&1; then echo yes; fi' $ echo $? 0
Created attachment 103213 [details] [review] Use a non-failing check for gtkdoc-rebase This changes the check for gtkdoc-rebase to be non-failing. It also suppresses the errors that `which' will print if it's not installed.
I should also mention that you don't need to use `which', and it just adds another build requirement. Since you only want to check for the existence of a utility and not store it's path, you can instead use `type', which all Bourne compatible shells have. $ type gtkdoc-rebase >/dev/null 2>&1 $ echo $? 1 $ type gcc >/dev/null 2>&1 $ echo $? 0
There was also Bug #509539 regarding this issue. We added a '-' to the whole statement. It was committed on the 17th. Is that fix enough?
Yeah, that's probably good enough, although you then ignore real errors from gtkdoc-rebase. I don't know exactly what gtkdoc-rebase does, but it would sort of stink to have the command bomb somewhere and leave you with a broken install.
It rewrites URLs. And it only exits with 0 incase of wrong commandline args. I'll close it as a duplicate for now. Thanks a lot, still. *** This bug has been marked as a duplicate of 509539 ***
Is it really a duplicate? Bug 509539 seems to have to do with `make dist'. This bug causes problems with `make install', in e-d-s, for example. I don't see how the fix for #509539 could prevent install-data-local from failing.
Lets taken bug #508897 then . sorry, I am a bit overworked. *** This bug has been marked as a duplicate of 508897 ***
Oh, I see. I saw that commit and thought it was working around the setting of the installfiles variable. But reading the comments in bug #508997 makes more sense. Not the solution I would have chosen since now install-data-local will always be successful even when it fails to do anything, but I guess that's what you want. Thanks for the quick replies.