leamas / spotify-make

Experimental, third-party installer for native linux spotify client
116 stars 15 forks source link

fix broken RHEL conditional #28

Closed aspiers closed 10 years ago

aspiers commented 10 years ago

$dist can be openSUSE project on openSUSE systems, so needs to be quoted.

Also, for consistency, and clarity of usage of POSIX vs. non-POSIX style conditionals, it is better to use either [ a = b ] or [[ a == b ]] rather than mixing the two: [ a == b ]

aspiers commented 10 years ago

You're right. I saw a bug and jumped to the incorrect conclusion that [ a == b ] was the culprit. (I knew it wasn't POSIX, but I didn't realise it was still valid bash.)

The real problem is that dist gets set to a multi-word value on openSUSE, since lsb_release -i returns Distributor ID: openSUSE project, resulting in $dist expanding to openSUSE project, which causes a bug when $dist is used unquoted in [ $dist == "RHEL" ]:

Determining distro:... (no "special configuration" of distro needed)...openSUSE project
Determining version:... 0.9.4.183.g644e24e.428
Determining arch:... amd64
./configure: line 211: [: too many arguments

I'll update the pull request accordingly.

leamas commented 10 years ago

Merged on command line (had to rebase to current master).

Thanks for this patch, and welcome onboard! Closing.