Bugzilla – Bug 3834
build-perl-modules.pl assumes that which exits with an error status
Last modified: 2011-03-16 04:34:11 UTC
build-perl-modules.pl uses "which" to determine if curl or wget is installed on the host computer. Unfortunately, when the specified file cannot be located, the which utility does not exit with a non-zero exit status on Solaris, OS X, nor HP/UX. It does, however, on Linux. At any rate, on those three platforms where it doesn't provide useful exit values, build-perl-modules.pl will attempt to use curl regardless of whether or not it is installed. That, of course, is in contradiction to the comments for building which state that either curl OR wget is required. One possible workaround would be to attempt to run the selected binary and then check the result of that; e.g., system("$cmd --version >/dev/null 2>&1"); but that itself is problematic as curl appears to exit with a 2 and wget a 0. Sigh. Alas, prompting for which to use -- curl or wget -- may be the only cross platform workaround. Either that or not using which at all, default to curl, and if the first attempted use fails, then try wget. However, that may lead to some poor error reporting. Anyhow, just wanted to bring this to your attention.
Fixed in change 8759