`which` is an external command which isn't required by POSIX.
Debian and other distributions (like Gentoo!) are looking
to drop it from their base set of packages.
Switch to `command -v` which is, however, POSIX. See https://lwn.net/Articles/874049/.
Jan Stary reported that on OpenBSD bash isn't located in /bin/
which means that the test fail. He also noted that there didn't
seem to be anything bash specific in the tests.
This patch takes some suggestions from Jan, plus a few fixes tested
on Debian using the bin/sh provided by bash and dash.
Suggested-by: Jan Stary <hans@stare.cz>
On Mac OSX, the 'wc -c' command returns a number with leading whitespace
which then results in a syntax error when the shell parser expects a
number when it really has a string containing a number. The easy fix is
to use string interpolation.
Closes: https://sourceforge.net/p/flac/bugs/420/
Reported-by: Mark Harris <mark.hsj@gmail.com>
The retune of compression levels makes this test fail. This is due
to a few approximations used in the encoder that determine which
LP coefficient should result in the smallest file. Differences are
usually very small, but in my case this resulted in compression
level 6 giving a 3 byte bigger file.
This patch lets the compression test pass even if the a compression
level results in a file that is up to 10 byte larger than the
previous level
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
The stat program has different command line parameters depend on
whether its the GNU or BSD version. Sitch to 'wc -c' instead which
seems more portable.
Plus other minor improvements.