Fix a few non-dash safe xstormy16 shell scripts.

Message ID 20190627011713.8689-1-jimw@sifive.com
State New
Headers show
Series
  • Fix a few non-dash safe xstormy16 shell scripts.
Related show

Commit Message

Jim Wilson June 27, 2019, 1:17 a.m.
Noticed by a customer while looking at a tangentially related problem.  The
gas testsuite for xstormy16 has two scripts that have a typo on the first
line, they are missing the !.  They also use shell syntax that doesn't work
on a system where /bin/sh is dash.  So I fixed the typo, changed the shell
to bash, and made them executable, so that they now work when run directly
even if /bin/sh is dash.

I don't see an xstormy16 maintainer, so I just committed them.

Jim

	gas/
	* testsuite/gas/xstormy16/allinsn.sh: Change first line to
	#!/bin/bash and make it executable.
	* testsuite/gas/xstormy16/gcc.sh: Likewise.
---
 gas/testsuite/gas/xstormy16/allinsn.sh | 2 +-
 gas/testsuite/gas/xstormy16/gcc.sh     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 gas/testsuite/gas/xstormy16/allinsn.sh
 mode change 100644 => 100755 gas/testsuite/gas/xstormy16/gcc.sh

-- 
2.17.1

Comments

Andreas Schwab June 27, 2019, 7:23 a.m. | #1
On Jun 26 2019, Jim Wilson <jimw@sifive.com> wrote:

> Noticed by a customer while looking at a tangentially related problem.  The

> gas testsuite for xstormy16 has two scripts that have a typo on the first

> line, they are missing the !.  They also use shell syntax that doesn't work

> on a system where /bin/sh is dash.


This is all that should be needed:

diff --git a/gas/testsuite/gas/xstormy16/allinsn.sh b/gas/testsuite/gas/xstormy16/allinsn.sh
index 03828f9c919..cae8b47c34b 100644
--- a/gas/testsuite/gas/xstormy16/allinsn.sh
+++ b/gas/testsuite/gas/xstormy16/allinsn.sh
@@ -25,7 +25,7 @@ rm -rf tmpdir
 mkdir tmpdir
 cd tmpdir
 
-function gentest {
+gentest () {
     rm -f a.out
     $BUILD/as-new ${1}.s -o a.out
     echo "#as:" >${1}.d
diff --git a/gas/testsuite/gas/xstormy16/gcc.sh b/gas/testsuite/gas/xstormy16/gcc.sh
index 1eb8972774c..35029c51db8 100644
--- a/gas/testsuite/gas/xstormy16/gcc.sh
+++ b/gas/testsuite/gas/xstormy16/gcc.sh
@@ -24,7 +24,7 @@ rm -rf tmpdir
 mkdir tmpdir
 cd tmpdir
 
-function gentest {
+gentest () {
     rm -f a.out
     $BUILD/as-new ${1}.s -o a.out
     echo "#as:" >${1}.d

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Patch

diff --git a/gas/testsuite/gas/xstormy16/allinsn.sh b/gas/testsuite/gas/xstormy16/allinsn.sh
old mode 100644
new mode 100755
index 03828f9c91..feb1a19e5b
--- a/gas/testsuite/gas/xstormy16/allinsn.sh
+++ b/gas/testsuite/gas/xstormy16/allinsn.sh
@@ -1,4 +1,4 @@ 
-#/bin/sh
+#!/bin/bash
 # Generate test result data for xstormy16 GAS testing.
 # This script is machine generated.
 # It is intended to be run in the testsuite source directory.
diff --git a/gas/testsuite/gas/xstormy16/gcc.sh b/gas/testsuite/gas/xstormy16/gcc.sh
old mode 100644
new mode 100755
index 1eb8972774..5a20f9e297
--- a/gas/testsuite/gas/xstormy16/gcc.sh
+++ b/gas/testsuite/gas/xstormy16/gcc.sh
@@ -1,4 +1,4 @@ 
-#/bin/sh
+#!/bin/bash
 # Generate test result data for xstormy16 GAS testing.
 # It is intended to be run in the testsuite source directory.
 #