Bug 3834 - build-perl-modules.pl assumes that which exits with an error status
: build-perl-modules.pl assumes that which exits with an error status
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 6.5b1
: Macintosh Other
: P4 minor (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-28 09:43 UTC by Dan Newman
Modified: 2011-03-16 04:34 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Newman 2006-07-28 09:43:38 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.
Comment 1 Dan Sully 2006-08-01 14:05:54 UTC
Fixed in change 8759