From aecb9792beaecf9d5423b0566595154c4cd6e10b Mon Sep 17 00:00:00 2001 From: James Laird Date: Sat, 23 Apr 2011 14:08:09 +1000 Subject: [PATCH] Bugfix: buggy users don't read INSTALL Probably some of them don't have the necessary prereqs to compile either, but at least now it tells them to read the INSTALL file instead of throwing an error about not finding 'hairtunes'. --- shairport.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shairport.pl b/shairport.pl index 889ff328..45969be6 100755 --- a/shairport.pl +++ b/shairport.pl @@ -56,6 +56,14 @@ my $daemon; # suppose hairtunes is under same directory my $hairtunes_cli = $FindBin::Bin . '/hairtunes'; +unless (-x $hairtunes_cli) { + say "Can't find the 'hairtunes' decoder binary, you need to build this before using Shairport."; + say "Trying to build it for you anyway..."; + system("cd ${FindBin::Bin}; make || gmake"); + die("Nope, didn't work out. Read the INSTALL instructions!") unless -x $hairtunes_cli; + say "Phew! Worked out okay, by the looks of it."; +} + GetOptions("a|apname=s" => \$apname, "p|password=s" => \$password, "i|pipe=s" => \$pipepath,