[flac-dev] flac-1.3.1pre1

Jan Stary hans at stare.cz
Wed Nov 26 15:47:34 PST 2014


On Nov 26 01:25:25, hans at stare.cz wrote:
> On Nov 25 23:56:05, mvanb1 at gmail.com wrote:
> > Op 25-11-14 om 23:39 schreef Jan Stary:
> > > Is there a reason the test scripts are calling bash?
> > 
> > The change from sh to bash was made a little more than a year 
> > ago. The mailing list thread accompanying this change can be 
> > found here: 
> > http://lists.xiph.org/pipermail/flac-dev/2013-September/004374.html
> 
> How unfortunate, if I may say so.
> 
> 	The main reason is that /bin/sh on linux can mean one of
> 	two things; bash in bourne shell comatibility mode or dash.
> 
> To accomodate a perverse system where /bin/sh does not mean sh(1),
> but one of two other shells (!), compatibility is broken
> for systems that either do not come with bash
> or install it anywhere else but /bin/bash.
> 
> 	The other issue is that using some bash features will allow me
> 	to reuse code and reduce the amount of shell script
> 	that needs to be mainatained.
> 
> Exactly which bash features are used here that sh(1) does not have,
> and how much of that code is reused so that it balances
> pissing off anything but a Linux distribution?

The diff below makes the tests run on my system (OpenBSD),
which does not have bash, and doesn't seem to break anything
on Debian Linux (3.2.0-4-amd64 #1 SMP Debian 3.2.63-2 x86_64).

I am sorry if the above comments seemed rude.
I genuinely don't think there is anything there
that would warrant using a nonstandard shell.

	Jan


--- test_bins.sh.orig	Thu Nov 27 00:16:05 2014
+++ test_bins.sh	Thu Nov 27 00:23:25 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2001-2009  Josh Coalson
@@ -18,7 +18,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 PATH=../src/flac:$PATH
 PATH=../objs/$BUILD/bin:$PATH
--- test_compression.sh.orig	Thu Nov 27 00:14:05 2014
+++ test_compression.sh	Thu Nov 27 00:15:11 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2012  Xiph.Org Foundation
@@ -17,7 +17,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 PATH=`pwd`/../src/flac:$PATH
 
@@ -39,7 +39,7 @@ for k in 0 1 2 3 4 5 6 7 8 ; do
 		echo "Error : Compression ${last_k} size $last_size >= compression $k size $size."
 		exit 1
 		fi
-	let last_size=${size}+10
+	last_size=$((${size}+10))
 	last_k=${k}
 	rm -f ${fname}
 	done
--- test_flac.sh.orig	Wed Nov 26 21:53:30 2014
+++ test_flac.sh	Wed Nov 26 21:53:39 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2001-2009  Josh Coalson
@@ -18,7 +18,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 # we use '.' as decimal separator in --skip/--until tests
 export LANG=C LC_ALL=C
--- test_grabbag.sh.orig	Wed Nov 26 21:53:02 2014
+++ test_grabbag.sh	Wed Nov 26 21:53:14 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2001-2009  Josh Coalson
@@ -18,7 +18,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 PATH=../src/test_grabbag/cuesheet:$PATH
 PATH=../src/test_grabbag/picture:$PATH
--- test_libFLAC++.sh.orig	Wed Nov 26 21:52:30 2014
+++ test_libFLAC++.sh	Wed Nov 26 21:52:45 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2002-2009  Josh Coalson
@@ -18,7 +18,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 PATH=../src/test_libFLAC++:$PATH
 PATH=../objs/$BUILD/bin:$PATH
--- test_libFLAC.sh.orig	Wed Nov 26 21:52:04 2014
+++ test_libFLAC.sh	Wed Nov 26 21:52:15 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2001-2009  Josh Coalson
@@ -18,7 +18,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 PATH=../src/test_libFLAC:$PATH
 PATH=../objs/$BUILD/bin:$PATH
--- test_metaflac.sh.orig	Wed Nov 26 22:05:03 2014
+++ test_metaflac.sh	Wed Nov 26 22:05:13 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2002-2009  Josh Coalson
@@ -18,7 +18,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 PATH=`pwd`/../src/flac:$PATH
 PATH=`pwd`/../src/metaflac:$PATH
--- test_replaygain.sh.orig	Wed Nov 26 22:15:36 2014
+++ test_replaygain.sh	Wed Nov 26 22:19:26 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2002-2009  Josh Coalson
@@ -18,7 +18,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 PATH=`pwd`/../src/flac:$PATH
 PATH=`pwd`/../src/metaflac:$PATH
--- test_seeking.sh.orig	Wed Nov 26 23:25:11 2014
+++ test_seeking.sh	Wed Nov 26 23:25:24 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2004-2009  Josh Coalson
@@ -18,7 +18,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 PATH=../src/flac:$PATH
 PATH=../src/metaflac:$PATH
--- test_streams.sh.orig	Wed Nov 26 23:26:23 2014
+++ test_streams.sh	Wed Nov 26 23:26:36 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 #  FLAC - Free Lossless Audio Codec
 #  Copyright (C) 2001-2009  Josh Coalson
@@ -18,7 +18,7 @@
 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
 #  distribution.
 
-source common.sh
+. ./common.sh
 
 PATH=../src/flac:$PATH
 PATH=../src/test_streams:$PATH
--- test_wrapper.sh.orig	Thu Nov 27 00:25:23 2014
+++ test_wrapper.sh	Thu Nov 27 00:25:28 2014
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 
 # This test script should exit on the first failure.
 


More information about the flac-dev mailing list