xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [OSSTEST PATCH 1/3] Remove obsolete file "test.sched"
@ 2015-09-24 17:29 Ian Jackson
  2015-09-24 17:29 ` [OSSTEST PATCH 2/3] Shell fixup: Make all invocations of `.' (`source') use ./ Ian Jackson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ian Jackson @ 2015-09-24 17:29 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 test.sched |    5 -----
 1 file changed, 5 deletions(-)
 delete mode 100755 test.sched

diff --git a/test.sched b/test.sched
deleted file mode 100755
index ca309fb..0000000
--- a/test.sched
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-set -e
-./ts-install-debian
-./ts-build-prep
-./ts-build-xen
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [OSSTEST PATCH 2/3] Shell fixup: Make all invocations of `.' (`source') use ./
  2015-09-24 17:29 [OSSTEST PATCH 1/3] Remove obsolete file "test.sched" Ian Jackson
@ 2015-09-24 17:29 ` Ian Jackson
  2015-09-25  8:40   ` Ian Campbell
  2015-09-24 17:29 ` [OSSTEST PATCH 3/3] Shell fixup: Use bash in posix mode Ian Jackson
  2015-09-25  8:37 ` [OSSTEST PATCH 1/3] Remove obsolete file "test.sched" Ian Campbell
  2 siblings, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2015-09-24 17:29 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

In POSIX, `.' (the shell builtin) respects PATH, and does not search
`.' (the current directory).

Change all the invocations which refer to files which are part of
osstest to say `. ./foo' instead of simply `. foo'.

I have checked the results of
  git-grep '^[ \t]*\. [^./]'
after this patch and the remaining five hits are of no concern.

As a double-check of my hand-editing, I have also done this
  perl -i~ -pe 's#^(\s*\. )\./#$1#' *
and verified that the resulting tree is almost identical to that
before this commit.  There is one difference, where the original
code already said `. ./job'.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 ap-fetch-version               |    6 +++---
 ap-fetch-version-baseline      |    2 +-
 ap-fetch-version-baseline-late |    6 +++---
 ap-fetch-version-old           |    6 +++---
 ap-print-url                   |    6 +++---
 ap-push                        |    6 +++---
 ap-qemu-revision               |    4 ++--
 ap-qemu-url                    |    4 ++--
 cr-all-branch-statuses         |    2 +-
 cr-daily-branch                |    4 ++--
 cr-try-bisect                  |    4 ++--
 cr-try-bisect-adhoc            |    6 +++---
 cri-args-hostlists             |    6 +++---
 cri-common                     |    4 ++--
 cri-lock-repos                 |    2 +-
 make-distros-flight            |    6 +++---
 make-flight                    |    8 ++++----
 mg-all-branch-statuses         |    2 +-
 mg-cpu-microcode-update        |    4 ++--
 mg-debian-installer-update     |    4 ++--
 mg-debian-installer-update-all |    2 +-
 mg-execute-flight              |    2 +-
 mg-pxe-loader-update           |    4 ++--
 standalone                     |    2 +-
 standalone-reset               |    4 ++--
 25 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/ap-fetch-version b/ap-fetch-version
index 62adf79..086aa62 100755
--- a/ap-fetch-version
+++ b/ap-fetch-version
@@ -20,10 +20,10 @@
 set -e
 
 branch=$1
-. cri-lock-repos
-. cri-common
+. ./cri-lock-repos
+. ./cri-common
 select_xenbranch
-. ap-common
+. ./ap-common
 
 if info_linux_tree "$branch"; then
 	repo_tree_rev_fetch_git linux \
diff --git a/ap-fetch-version-baseline b/ap-fetch-version-baseline
index e693e16..8889d1e 100755
--- a/ap-fetch-version-baseline
+++ b/ap-fetch-version-baseline
@@ -21,7 +21,7 @@ set -e
 
 branch=$1
 
-. cri-lock-repos
+. ./cri-lock-repos
 
 : ${BASE_TREE_LINUX:=git://xenbits.xen.org/people/ianc/linux-2.6.git}
 : ${BASE_TAG_LINUX:=xen/next-2.6.32}
diff --git a/ap-fetch-version-baseline-late b/ap-fetch-version-baseline-late
index ef1a8b1..3db443d 100755
--- a/ap-fetch-version-baseline-late
+++ b/ap-fetch-version-baseline-late
@@ -22,10 +22,10 @@ set -e
 branch=$1
 new=$2
 
-. cri-lock-repos
-. cri-common
+. ./cri-lock-repos
+. ./cri-common
 select_xenbranch
-. ap-common
+. ./ap-common
 
 case "$branch" in
 
diff --git a/ap-fetch-version-old b/ap-fetch-version-old
index 716fc8f..9d5487a 100755
--- a/ap-fetch-version-old
+++ b/ap-fetch-version-old
@@ -20,10 +20,10 @@
 set -e
 
 branch=$1
-. cri-lock-repos
-. cri-common
+. ./cri-lock-repos
+. ./cri-common
 select_xenbranch
-. ap-common
+. ./ap-common
 
 : ${BASE_TAG_LINUX2639:=tested/2.6.39.x}
 : ${BASE_LOCALREV_LINUX:=daily-cron.$branch.old}
diff --git a/ap-print-url b/ap-print-url
index c161169..1b178c7 100755
--- a/ap-print-url
+++ b/ap-print-url
@@ -20,10 +20,10 @@
 set -e
 
 branch=$1
-. cri-lock-repos
-. cri-common
+. ./cri-lock-repos
+. ./cri-common
 select_xenbranch
-. ap-common
+. ./ap-common
 
 if info_linux_tree "$branch"; then
 	echo $TREE_LINUX_THIS
diff --git a/ap-push b/ap-push
index aa0ec3d..ea21887 100755
--- a/ap-push
+++ b/ap-push
@@ -21,13 +21,13 @@ set -ex
 
 branch=$1
 revision=$2
-. cri-lock-repos
-. cri-common
+. ./cri-lock-repos
+. ./cri-common
 select_xenbranch
 
 : ${TAG_LINUX2639:=tested/2.6.39.x}
 
-. ap-common
+. ./ap-common
 
 TREE_LINUX=$PUSH_TREE_LINUX
 TREE_QEMU_MAINLINE=$PUSH_TREE_QEMU_MAINLINE
diff --git a/ap-qemu-revision b/ap-qemu-revision
index abfa650..de105ca 100755
--- a/ap-qemu-revision
+++ b/ap-qemu-revision
@@ -22,8 +22,8 @@ set -e
 xenbranch=$1
 xenrevision=$2
 
-. cri-lock-repos
-. ap-common
+. ./cri-lock-repos
+. ./ap-common
 
 cd "$repos/xen"
 git cat-file blob $xenrevision:Config.mk | perl -ne '
diff --git a/ap-qemu-url b/ap-qemu-url
index 1161a46..6ed704a 100755
--- a/ap-qemu-url
+++ b/ap-qemu-url
@@ -21,7 +21,7 @@ set -e
 
 xenbranch=$1
 
-. cri-lock-repos
-. ap-common
+. ./cri-lock-repos
+. ./ap-common
 
 echo $TREE_QEMU
diff --git a/cr-all-branch-statuses b/cr-all-branch-statuses
index f9885db..f4ed46e 100755
--- a/cr-all-branch-statuses
+++ b/cr-all-branch-statuses
@@ -18,7 +18,7 @@
 
 set -ex
 
-. cri-args-hostlists
+. ./cri-args-hostlists
 branch=$1; shift
 
 check_stop all-branch-statuses.
diff --git a/cr-daily-branch b/cr-daily-branch
index dd9c30a..06f4b38 100755
--- a/cr-daily-branch
+++ b/cr-daily-branch
@@ -19,8 +19,8 @@
 
 set -ex
 
-. cri-args-hostlists
-. ap-common
+. ./cri-args-hostlists
+. ./ap-common
 branch=$1; shift
 select_branch
 info_linux_tree $branch ||:
diff --git a/cr-try-bisect b/cr-try-bisect
index 8f00537..06c4940 100755
--- a/cr-try-bisect
+++ b/cr-try-bisect
@@ -19,8 +19,8 @@
 
 set -ex
 
-. cri-bisect
-. cri-args-hostlists
+. ./cri-bisect
+. ./cri-args-hostlists
 
 branch=$1; shift
 select_branch
diff --git a/cr-try-bisect-adhoc b/cr-try-bisect-adhoc
index c34c74c..4ff8b8c 100755
--- a/cr-try-bisect-adhoc
+++ b/cr-try-bisect-adhoc
@@ -21,7 +21,7 @@ set -ex
 
 export OSSTEST_BLESSING=adhoc
 
-. cri-common
+. ./cri-common
 
 nope () { echo "nope: $*"; exit 0; }
 
@@ -34,8 +34,8 @@ if ! test -f job; then nope "no job"; exit 0; fi
 #   testid=
 #   bisect= list of args to cs-bisection-step, eg  '--fail-flight=<mumble>'
 
-. cri-bisect
-. cri-args-hostlists
+. ./cri-bisect
+. ./cri-args-hostlists
 select_branch
 
 export OSSTEST_BLESSING=adhoc
diff --git a/cri-args-hostlists b/cri-args-hostlists
index 0dd2ef3..58a2252 100644
--- a/cri-args-hostlists
+++ b/cri-args-hostlists
@@ -34,13 +34,13 @@ check_stop () {
 	check_stop_core "$1"
 	if test -f ${1}xsettings; then
 		echo "loading ${1}xsettings"
-		. ${1}xsettings
+		. ./${1}xsettings
 	fi
 }
 
 check_stop ''
 
-. cri-common
+. ./cri-common
 
 dcs=daily-cron-settings
 
@@ -56,7 +56,7 @@ fi
 
 : ${OSSTEST_EMAIL_HEADER:=daily-cron-email-$OSSTEST_BLESSING}
 
-. ${OSSTEST_CRON_SETTINGS:-$dcs-$OSSTEST_BLESSING}
+. ./${OSSTEST_CRON_SETTINGS:-$dcs-$OSSTEST_BLESSING}
 
 : ${OSSTEST_PUSH:=false}
 
diff --git a/cri-common b/cri-common
index c874ff9..6dfe8df 100644
--- a/cri-common
+++ b/cri-common
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-. cri-getconfig
+. ./cri-getconfig
 
 umask 002
 
@@ -101,6 +101,6 @@ select_branch () {
 	mrof="$branch.mro"
 
 	if test -f branch-settings.$branch; then
-		. branch-settings.$branch
+		. ./branch-settings.$branch
 	fi
 }
diff --git a/cri-lock-repos b/cri-lock-repos
index c8269f3..e75e3f5 100644
--- a/cri-lock-repos
+++ b/cri-lock-repos
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-. cri-common
+. ./cri-common
 
 repos=`getrepos`
 repos_lock="$repos/lock"
diff --git a/make-distros-flight b/make-distros-flight
index d407fcb..697a171 100755
--- a/make-distros-flight
+++ b/make-distros-flight
@@ -26,9 +26,9 @@ buildflight=$4
 
 flight=`./cs-flight-create $blessing $branch`
 
-. cri-common
-. ap-common
-. mfi-common
+. ./cri-common
+. ./ap-common
+. ./mfi-common
 
 defsuite=`getconfig DebianSuite`
 defguestsuite=`getconfig GuestDebianSuite`
diff --git a/make-flight b/make-flight
index 70c909d..8dc4e64 100755
--- a/make-flight
+++ b/make-flight
@@ -26,10 +26,10 @@ buildflight=$4
 
 flight=`./cs-flight-create $blessing $branch`
 
-. cri-common
-. cri-getplatforms
-. ap-common
-. mfi-common
+. ./cri-common
+. ./cri-getplatforms
+. ./ap-common
+. ./mfi-common
 
 defsuite=`getconfig DebianSuite`
 defguestsuite=`getconfig GuestDebianSuite`
diff --git a/mg-all-branch-statuses b/mg-all-branch-statuses
index bba7216..74dc09a 100755
--- a/mg-all-branch-statuses
+++ b/mg-all-branch-statuses
@@ -27,7 +27,7 @@
 
 set -e
 
-. cri-common
+. ./cri-common
 
 mkdir -p tmp
 
diff --git a/mg-cpu-microcode-update b/mg-cpu-microcode-update
index c375a43..4d51dfb 100755
--- a/mg-cpu-microcode-update
+++ b/mg-cpu-microcode-update
@@ -2,8 +2,8 @@
 
 set -e
 
-. cri-getconfig
-. mgi-common
+. ./cri-getconfig
+. ./mgi-common
 
 # iucode_tool is in /usr/sbin, see #788459.
 export PATH="/usr/local/sbin:$PATH:/sbin:/usr/sbin"
diff --git a/mg-debian-installer-update b/mg-debian-installer-update
index 526cdf1..6070b8a 100755
--- a/mg-debian-installer-update
+++ b/mg-debian-installer-update
@@ -21,8 +21,8 @@
 
 set -e
 
-. cri-getconfig
-. mgi-common
+. ./cri-getconfig
+. ./mgi-common
 
 suite=$1
 arch=$2
diff --git a/mg-debian-installer-update-all b/mg-debian-installer-update-all
index 241e2e3..1bbaef7 100755
--- a/mg-debian-installer-update-all
+++ b/mg-debian-installer-update-all
@@ -20,7 +20,7 @@
 
 set -e
 
-. cri-getconfig
+. ./cri-getconfig
 
 suite=`getconfig DebianSuite`
 fws=`getconfig DebianNonfreeFirmware`
diff --git a/mg-execute-flight b/mg-execute-flight
index 7f3d969..0d8c792 100755
--- a/mg-execute-flight
+++ b/mg-execute-flight
@@ -48,7 +48,7 @@ while [ $# != 0 ]; do
 	esac
 done
 
-. cri-getconfig
+. ./cri-getconfig
 
 if [ x"$flight" = x ]; then badusage; fi
 
diff --git a/mg-pxe-loader-update b/mg-pxe-loader-update
index 386e449..9774350 100755
--- a/mg-pxe-loader-update
+++ b/mg-pxe-loader-update
@@ -23,8 +23,8 @@
 
 set -e
 
-. cri-getconfig
-. mgi-common
+. ./cri-getconfig
+. ./mgi-common
 
 suite=$1
 
diff --git a/standalone b/standalone
index 60b6666..9383d72 100755
--- a/standalone
+++ b/standalone
@@ -123,7 +123,7 @@ while true ; do
     esac
 done
 
-. cri-getconfig
+. ./cri-getconfig
 
 WebspaceLog=`OSSTEST_CONFIG=$config getconfig WebspaceLog`
 if [ ! -r "$WebspaceLog" ] ; then
diff --git a/standalone-reset b/standalone-reset
index 8555039..0a69915 100755
--- a/standalone-reset
+++ b/standalone-reset
@@ -37,10 +37,10 @@ done
 shift $((OPTIND-1))
 
 if [ -f standalone.config ] ; then
-    . standalone.config
+    . ./standalone.config
 fi
 
-. cri-getconfig
+. ./cri-getconfig
 
 jobdb=`getconfig JobDB`
 if [ "$jobdb" != Standalone ]; then
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [OSSTEST PATCH 3/3] Shell fixup: Use bash in posix mode
  2015-09-24 17:29 [OSSTEST PATCH 1/3] Remove obsolete file "test.sched" Ian Jackson
  2015-09-24 17:29 ` [OSSTEST PATCH 2/3] Shell fixup: Make all invocations of `.' (`source') use ./ Ian Jackson
@ 2015-09-24 17:29 ` Ian Jackson
  2015-09-25  8:47   ` Ian Campbell
  2015-09-25  8:37 ` [OSSTEST PATCH 1/3] Remove obsolete file "test.sched" Ian Campbell
  2 siblings, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2015-09-24 17:29 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

When bash is started as /bin/sh it run in posix compatibility mode.
But when invoked as /bin/bash it does some things ... differently.

Most notably:

   Subshells spawned to execute command substitutions inherit the
   value of the -e option from the parent shell.  When not in posix
   mode, bash clears the -e option in such subshells.

It is a mystery why anyone thought the `non-posix' behaviour was
desirable.  One effect in practice is that osstest's cr-daily-branch
can blunder on if one of its version fetches fails.

AFAICT the only documented way to get rid of this anomalous behaviour
is to switch bash to posix mode.  I have read through the wheezy
bash(1) manpage and searched for posix, and the following behavioural
differences are described:

 * Differences in interative startup (not relevant to us).
 * Minor (irrelevant) differences in which startup files are read
   during noninteractive startup.  (Eg, BASH_ENV not honoured.)
 * Differences to the parsing of invocations of `time'
 * `test a == b' may be unsupported (but it's wrong and we say `=')
 * -e not inherited by some subshells (this is what I am trying to fix)
 * `.' and `source' do not search the cwd.
 * `set' with no arguments does not print shell functions etc.

So I think, with the previous patch, that these changes are all
desirable or at least harmless.

I have not added `set -o posix' to shell script fragments invoked by
various scripts (eg Perl and Tcl scripts).  Those scripts might be
processed by bash if /bin/sh is bash, but when is invoked as sh it
runs in posix mode anyway.

I have done some ad-hoc testing but it seems like much of this is
difficult to test.  I suggest we push it at a time when we can keep a
close eye on the behaviour.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 ap-fetch-version                        |    2 +-
 ap-fetch-version-baseline               |    2 +-
 ap-fetch-version-baseline-late          |    2 +-
 ap-fetch-version-old                    |    2 +-
 ap-print-url                            |    2 +-
 ap-push                                 |    2 +-
 ap-qemu-revision                        |    2 +-
 ap-qemu-url                             |    2 +-
 cr-all-branch-statuses                  |    2 +-
 cr-daily-branch                         |    2 +-
 cr-for-branches                         |    2 +-
 cr-try-bisect                           |    2 +-
 cr-try-bisect-adhoc                     |    2 +-
 cri-getprevxenbranch                    |    2 +-
 invoke-daemon                           |    4 +++-
 make-distros-flight                     |    2 +-
 make-flight                             |    2 +-
 mg-adjust-flight-makexrefs              |    2 +-
 mg-all-branch-statuses                  |    2 +-
 mg-branch-setup                         |    2 +-
 mg-cpu-microcode-update                 |    2 +-
 mg-debian-installer-update              |    2 +-
 mg-debian-installer-update-all          |    2 +-
 mg-execute-flight                       |    2 +-
 mg-pxe-loader-update                    |    2 +-
 mg-update-live                          |    2 +-
 sa-forget-flight                        |    2 +-
 sa-init-db                              |    2 +-
 sg-hg-heads                             |    2 +-
 standalone                              |    2 +-
 standalone-generate-dump-flight-runvars |    2 +-
 standalone-reset                        |    2 +-
 32 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/ap-fetch-version b/ap-fetch-version
index 086aa62..6fa7588 100755
--- a/ap-fetch-version
+++ b/ap-fetch-version
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 branch=$1
 . ./cri-lock-repos
diff --git a/ap-fetch-version-baseline b/ap-fetch-version-baseline
index 8889d1e..2e42508 100755
--- a/ap-fetch-version-baseline
+++ b/ap-fetch-version-baseline
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 branch=$1
 
diff --git a/ap-fetch-version-baseline-late b/ap-fetch-version-baseline-late
index 3db443d..9856ec9 100755
--- a/ap-fetch-version-baseline-late
+++ b/ap-fetch-version-baseline-late
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 branch=$1
 new=$2
diff --git a/ap-fetch-version-old b/ap-fetch-version-old
index 9d5487a..66d51f8 100755
--- a/ap-fetch-version-old
+++ b/ap-fetch-version-old
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 branch=$1
 . ./cri-lock-repos
diff --git a/ap-print-url b/ap-print-url
index 1b178c7..4088852 100755
--- a/ap-print-url
+++ b/ap-print-url
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 branch=$1
 . ./cri-lock-repos
diff --git a/ap-push b/ap-push
index ea21887..d2195f2 100755
--- a/ap-push
+++ b/ap-push
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -ex
+set -ex -o posix
 
 branch=$1
 revision=$2
diff --git a/ap-qemu-revision b/ap-qemu-revision
index de105ca..d08cffe 100755
--- a/ap-qemu-revision
+++ b/ap-qemu-revision
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 xenbranch=$1
 xenrevision=$2
diff --git a/ap-qemu-url b/ap-qemu-url
index 6ed704a..61598f6 100755
--- a/ap-qemu-url
+++ b/ap-qemu-url
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 xenbranch=$1
 
diff --git a/cr-all-branch-statuses b/cr-all-branch-statuses
index f4ed46e..46028ba 100755
--- a/cr-all-branch-statuses
+++ b/cr-all-branch-statuses
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set -ex
+set -ex -o posix
 
 . ./cri-args-hostlists
 branch=$1; shift
diff --git a/cr-daily-branch b/cr-daily-branch
index 06f4b38..c7cc33b 100755
--- a/cr-daily-branch
+++ b/cr-daily-branch
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -ex
+set -ex -o posix
 
 . ./cri-args-hostlists
 . ./ap-common
diff --git a/cr-for-branches b/cr-for-branches
index 8d5748b..757045d 100755
--- a/cr-for-branches
+++ b/cr-for-branches
@@ -20,7 +20,7 @@
 
 
 
-set -e
+set -e -o posix
 
 export FOR_LOGFILE="$*"
 
diff --git a/cr-try-bisect b/cr-try-bisect
index 06c4940..2a5fe09 100755
--- a/cr-try-bisect
+++ b/cr-try-bisect
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -ex
+set -ex -o posix
 
 . ./cri-bisect
 . ./cri-args-hostlists
diff --git a/cr-try-bisect-adhoc b/cr-try-bisect-adhoc
index 4ff8b8c..5f8b7e1 100755
--- a/cr-try-bisect-adhoc
+++ b/cr-try-bisect-adhoc
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -ex
+set -ex -o posix
 
 export OSSTEST_BLESSING=adhoc
 
diff --git a/cri-getprevxenbranch b/cri-getprevxenbranch
index 308b0c7..a70138e 100755
--- a/cri-getprevxenbranch
+++ b/cri-getprevxenbranch
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-set -e
+set -e -o posix
 
 xenbranch=$1
 p=
diff --git a/invoke-daemon b/invoke-daemon
index 5fab1da..ad1434a 100755
--- a/invoke-daemon
+++ b/invoke-daemon
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/bash
 
 # This is part of "osstest", an automated testing framework for Xen.
 # Copyright (C) 2009-2013 Citrix Inc.
@@ -16,6 +16,8 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+set -e -o posix
+
 if [ -e $HOME/.xen-osstest/settings ]; then
      source $HOME/.xen-osstest/settings
 fi
diff --git a/make-distros-flight b/make-distros-flight
index 697a171..90e28c3 100755
--- a/make-distros-flight
+++ b/make-distros-flight
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 branch=$1
 xenbranch=$2
diff --git a/make-flight b/make-flight
index 8dc4e64..8c75a9c 100755
--- a/make-flight
+++ b/make-flight
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 branch=$1
 xenbranch=$2
diff --git a/mg-adjust-flight-makexrefs b/mg-adjust-flight-makexrefs
index ebbac15..ec555bc 100755
--- a/mg-adjust-flight-makexrefs
+++ b/mg-adjust-flight-makexrefs
@@ -22,7 +22,7 @@
 #             passing --debug in REF-CONDS too)
 #   -n      Dry run: do not actually run cs-adjust-flight
 
-set -e
+set -e -o posix
 
 exec 3>/dev/null
 verbose=''
diff --git a/mg-all-branch-statuses b/mg-all-branch-statuses
index 74dc09a..d3e437f 100755
--- a/mg-all-branch-statuses
+++ b/mg-all-branch-statuses
@@ -25,7 +25,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set -e
+set -e -o posix
 
 . ./cri-common
 
diff --git a/mg-branch-setup b/mg-branch-setup
index f8bcb2e..6a9bd3f 100755
--- a/mg-branch-setup
+++ b/mg-branch-setup
@@ -15,7 +15,7 @@
 #  - create any input/output tree on xenbits
 #  - run any test flights (obviously)
 
-set -e
+set -e -o posix
 
 fail () { echo >&2 "$*"; exit 1; }
 badusage () { fail 'bad usage'; }
diff --git a/mg-cpu-microcode-update b/mg-cpu-microcode-update
index 4d51dfb..1032025 100755
--- a/mg-cpu-microcode-update
+++ b/mg-cpu-microcode-update
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-set -e
+set -e -o posix
 
 . ./cri-getconfig
 . ./mgi-common
diff --git a/mg-debian-installer-update b/mg-debian-installer-update
index 6070b8a..7e3fb20 100755
--- a/mg-debian-installer-update
+++ b/mg-debian-installer-update
@@ -19,7 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 . ./cri-getconfig
 . ./mgi-common
diff --git a/mg-debian-installer-update-all b/mg-debian-installer-update-all
index 1bbaef7..4e76a69 100755
--- a/mg-debian-installer-update-all
+++ b/mg-debian-installer-update-all
@@ -18,7 +18,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set -e
+set -e -o posix
 
 . ./cri-getconfig
 
diff --git a/mg-execute-flight b/mg-execute-flight
index 0d8c792..8b2c21c 100755
--- a/mg-execute-flight
+++ b/mg-execute-flight
@@ -29,7 +29,7 @@ usage () { cat <<END
 END
 }
 
-set -e
+set -e -o posix
 
 publish=false
 
diff --git a/mg-pxe-loader-update b/mg-pxe-loader-update
index 9774350..e0e347d 100755
--- a/mg-pxe-loader-update
+++ b/mg-pxe-loader-update
@@ -21,7 +21,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -e -o posix
 
 . ./cri-getconfig
 . ./mgi-common
diff --git a/mg-update-live b/mg-update-live
index f1d24cd..3ff7ffa 100755
--- a/mg-update-live
+++ b/mg-update-live
@@ -22,7 +22,7 @@
 #  cd ~osstest
 #  for f in branches/*.git; do ./update-live 3c464fbf8a05b24f4afb7e58bcf4ae77fbb7ad0c $f; done
 
-set -e
+set -e -o posix
 bad="$1"
 dir="$2"
 
diff --git a/sa-forget-flight b/sa-forget-flight
index 8b005f1..1c3ecb2 100755
--- a/sa-forget-flight
+++ b/sa-forget-flight
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set -e
+set -e -o posix
 
 usage(){
 	cat <<END
diff --git a/sa-init-db b/sa-init-db
index 37ab4be..bd9aa4a 100755
--- a/sa-init-db
+++ b/sa-init-db
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set -e
+set -e -o posix
 
 usage(){
 	cat <<END
diff --git a/sg-hg-heads b/sg-hg-heads
index 41ec734..b2dd601 100755
--- a/sg-hg-heads
+++ b/sg-hg-heads
@@ -21,7 +21,7 @@
 #  where COMMAND ARGS SCRIPT
 #  runs shell script SCRIPT in an appropriate directory and place
 
-set -e
+set -e -o posix
 
 result=`"$@" 'hg heads --template '\''{node|short}\n'\'''`
 lines=`printf '%s\n' "$result" | wc -l`
diff --git a/standalone b/standalone
index 9383d72..168a46c 100755
--- a/standalone
+++ b/standalone
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-set -e
+set -e -o posix
 
 usage() {
     cat >&2 <<EOF
diff --git a/standalone-generate-dump-flight-runvars b/standalone-generate-dump-flight-runvars
index da3c0f8..d113927 100755
--- a/standalone-generate-dump-flight-runvars
+++ b/standalone-generate-dump-flight-runvars
@@ -24,7 +24,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set -e
+set -e -o posix
 
 set -o pipefail
 
diff --git a/standalone-reset b/standalone-reset
index 0a69915..e58ba68 100755
--- a/standalone-reset
+++ b/standalone-reset
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set -e
+set -e -o posix
 
 usage(){
 	cat <<END
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OSSTEST PATCH 1/3] Remove obsolete file "test.sched"
  2015-09-24 17:29 [OSSTEST PATCH 1/3] Remove obsolete file "test.sched" Ian Jackson
  2015-09-24 17:29 ` [OSSTEST PATCH 2/3] Shell fixup: Make all invocations of `.' (`source') use ./ Ian Jackson
  2015-09-24 17:29 ` [OSSTEST PATCH 3/3] Shell fixup: Use bash in posix mode Ian Jackson
@ 2015-09-25  8:37 ` Ian Campbell
  2 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2015-09-25  8:37 UTC (permalink / raw)
  To: Ian Jackson, xen-devel

On Thu, 2015-09-24 at 18:29 +0100, Ian Jackson wrote:
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

(Happily too because it always knackers tab completion for my local test
-foo.sh scripts ;-))

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OSSTEST PATCH 2/3] Shell fixup: Make all invocations of `.' (`source') use ./
  2015-09-24 17:29 ` [OSSTEST PATCH 2/3] Shell fixup: Make all invocations of `.' (`source') use ./ Ian Jackson
@ 2015-09-25  8:40   ` Ian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2015-09-25  8:40 UTC (permalink / raw)
  To: Ian Jackson, xen-devel

On Thu, 2015-09-24 at 18:29 +0100, Ian Jackson wrote:
> In POSIX, `.' (the shell builtin) respects PATH, and does not search
> `.' (the current directory).
> 
> Change all the invocations which refer to files which are part of
> osstest to say `. ./foo' instead of simply `. foo'.
> 
> I have checked the results of
>   git-grep '^[ \t]*\. [^./]'
> after this patch and the remaining five hits are of no concern.
> 
> As a double-check of my hand-editing, I have also done this
>   perl -i~ -pe 's#^(\s*\. )\./#$1#' *
> and verified that the resulting tree is almost identical to that
> before this commit.  There is one difference, where the original
> code already said `. ./job'.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

I think there are good reasons for not simply adding . to $PATH at the top
of the various scripts.

> ---
>  ap-fetch-version               |    6 +++---
>  ap-fetch-version-baseline      |    2 +-
>  ap-fetch-version-baseline-late |    6 +++---
>  ap-fetch-version-old           |    6 +++---
>  ap-print-url                   |    6 +++---
>  ap-push                        |    6 +++---
>  ap-qemu-revision               |    4 ++--
>  ap-qemu-url                    |    4 ++--
>  cr-all-branch-statuses         |    2 +-
>  cr-daily-branch                |    4 ++--
>  cr-try-bisect                  |    4 ++--
>  cr-try-bisect-adhoc            |    6 +++---
>  cri-args-hostlists             |    6 +++---
>  cri-common                     |    4 ++--
>  cri-lock-repos                 |    2 +-
>  make-distros-flight            |    6 +++---
>  make-flight                    |    8 ++++----
>  mg-all-branch-statuses         |    2 +-
>  mg-cpu-microcode-update        |    4 ++--
>  mg-debian-installer-update     |    4 ++--
>  mg-debian-installer-update-all |    2 +-
>  mg-execute-flight              |    2 +-
>  mg-pxe-loader-update           |    4 ++--
>  standalone                     |    2 +-
>  standalone-reset               |    4 ++--
>  25 files changed, 53 insertions(+), 53 deletions(-)
> 
> diff --git a/ap-fetch-version b/ap-fetch-version
> index 62adf79..086aa62 100755
> --- a/ap-fetch-version
> +++ b/ap-fetch-version
> @@ -20,10 +20,10 @@
>  set -e
>  
>  branch=$1
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
> -. ap-common
> +. ./ap-common
>  
>  if info_linux_tree "$branch"; then
>  	repo_tree_rev_fetch_git linux \
> diff --git a/ap-fetch-version-baseline b/ap-fetch-version-baseline
> index e693e16..8889d1e 100755
> --- a/ap-fetch-version-baseline
> +++ b/ap-fetch-version-baseline
> @@ -21,7 +21,7 @@ set -e
>  
>  branch=$1
>  
> -. cri-lock-repos
> +. ./cri-lock-repos
>  
>  : ${BASE_TREE_LINUX:=git://xenbits.xen.org/people/ianc/linux-2.6.git}
>  : ${BASE_TAG_LINUX:=xen/next-2.6.32}
> diff --git a/ap-fetch-version-baseline-late b/ap-fetch-version-baseline
> -late
> index ef1a8b1..3db443d 100755
> --- a/ap-fetch-version-baseline-late
> +++ b/ap-fetch-version-baseline-late
> @@ -22,10 +22,10 @@ set -e
>  branch=$1
>  new=$2
>  
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
> -. ap-common
> +. ./ap-common
>  
>  case "$branch" in
>  
> diff --git a/ap-fetch-version-old b/ap-fetch-version-old
> index 716fc8f..9d5487a 100755
> --- a/ap-fetch-version-old
> +++ b/ap-fetch-version-old
> @@ -20,10 +20,10 @@
>  set -e
>  
>  branch=$1
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
> -. ap-common
> +. ./ap-common
>  
>  : ${BASE_TAG_LINUX2639:=tested/2.6.39.x}
>  : ${BASE_LOCALREV_LINUX:=daily-cron.$branch.old}
> diff --git a/ap-print-url b/ap-print-url
> index c161169..1b178c7 100755
> --- a/ap-print-url
> +++ b/ap-print-url
> @@ -20,10 +20,10 @@
>  set -e
>  
>  branch=$1
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
> -. ap-common
> +. ./ap-common
>  
>  if info_linux_tree "$branch"; then
>  	echo $TREE_LINUX_THIS
> diff --git a/ap-push b/ap-push
> index aa0ec3d..ea21887 100755
> --- a/ap-push
> +++ b/ap-push
> @@ -21,13 +21,13 @@ set -ex
>  
>  branch=$1
>  revision=$2
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
>  
>  : ${TAG_LINUX2639:=tested/2.6.39.x}
>  
> -. ap-common
> +. ./ap-common
>  
>  TREE_LINUX=$PUSH_TREE_LINUX
>  TREE_QEMU_MAINLINE=$PUSH_TREE_QEMU_MAINLINE
> diff --git a/ap-qemu-revision b/ap-qemu-revision
> index abfa650..de105ca 100755
> --- a/ap-qemu-revision
> +++ b/ap-qemu-revision
> @@ -22,8 +22,8 @@ set -e
>  xenbranch=$1
>  xenrevision=$2
>  
> -. cri-lock-repos
> -. ap-common
> +. ./cri-lock-repos
> +. ./ap-common
>  
>  cd "$repos/xen"
>  git cat-file blob $xenrevision:Config.mk | perl -ne '
> diff --git a/ap-qemu-url b/ap-qemu-url
> index 1161a46..6ed704a 100755
> --- a/ap-qemu-url
> +++ b/ap-qemu-url
> @@ -21,7 +21,7 @@ set -e
>  
>  xenbranch=$1
>  
> -. cri-lock-repos
> -. ap-common
> +. ./cri-lock-repos
> +. ./ap-common
>  
>  echo $TREE_QEMU
> diff --git a/cr-all-branch-statuses b/cr-all-branch-statuses
> index f9885db..f4ed46e 100755
> --- a/cr-all-branch-statuses
> +++ b/cr-all-branch-statuses
> @@ -18,7 +18,7 @@
>  
>  set -ex
>  
> -. cri-args-hostlists
> +. ./cri-args-hostlists
>  branch=$1; shift
>  
>  check_stop all-branch-statuses.
> diff --git a/cr-daily-branch b/cr-daily-branch
> index dd9c30a..06f4b38 100755
> --- a/cr-daily-branch
> +++ b/cr-daily-branch
> @@ -19,8 +19,8 @@
>  
>  set -ex
>  
> -. cri-args-hostlists
> -. ap-common
> +. ./cri-args-hostlists
> +. ./ap-common
>  branch=$1; shift
>  select_branch
>  info_linux_tree $branch ||:
> diff --git a/cr-try-bisect b/cr-try-bisect
> index 8f00537..06c4940 100755
> --- a/cr-try-bisect
> +++ b/cr-try-bisect
> @@ -19,8 +19,8 @@
>  
>  set -ex
>  
> -. cri-bisect
> -. cri-args-hostlists
> +. ./cri-bisect
> +. ./cri-args-hostlists
>  
>  branch=$1; shift
>  select_branch
> diff --git a/cr-try-bisect-adhoc b/cr-try-bisect-adhoc
> index c34c74c..4ff8b8c 100755
> --- a/cr-try-bisect-adhoc
> +++ b/cr-try-bisect-adhoc
> @@ -21,7 +21,7 @@ set -ex
>  
>  export OSSTEST_BLESSING=adhoc
>  
> -. cri-common
> +. ./cri-common
>  
>  nope () { echo "nope: $*"; exit 0; }
>  
> @@ -34,8 +34,8 @@ if ! test -f job; then nope "no job"; exit 0; fi
>  #   testid=
>  #   bisect= list of args to cs-bisection-step, eg  '--fail
> -flight=<mumble>'
>  
> -. cri-bisect
> -. cri-args-hostlists
> +. ./cri-bisect
> +. ./cri-args-hostlists
>  select_branch
>  
>  export OSSTEST_BLESSING=adhoc
> diff --git a/cri-args-hostlists b/cri-args-hostlists
> index 0dd2ef3..58a2252 100644
> --- a/cri-args-hostlists
> +++ b/cri-args-hostlists
> @@ -34,13 +34,13 @@ check_stop () {
>  	check_stop_core "$1"
>  	if test -f ${1}xsettings; then
>  		echo "loading ${1}xsettings"
> -		. ${1}xsettings
> +		. ./${1}xsettings
>  	fi
>  }
>  
>  check_stop ''
>  
> -. cri-common
> +. ./cri-common
>  
>  dcs=daily-cron-settings
>  
> @@ -56,7 +56,7 @@ fi
>  
>  : ${OSSTEST_EMAIL_HEADER:=daily-cron-email-$OSSTEST_BLESSING}
>  
> -. ${OSSTEST_CRON_SETTINGS:-$dcs-$OSSTEST_BLESSING}
> +. ./${OSSTEST_CRON_SETTINGS:-$dcs-$OSSTEST_BLESSING}
>  
>  : ${OSSTEST_PUSH:=false}
>  
> diff --git a/cri-common b/cri-common
> index c874ff9..6dfe8df 100644
> --- a/cri-common
> +++ b/cri-common
> @@ -17,7 +17,7 @@
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>  
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  umask 002
>  
> @@ -101,6 +101,6 @@ select_branch () {
>  	mrof="$branch.mro"
>  
>  	if test -f branch-settings.$branch; then
> -		. branch-settings.$branch
> +		. ./branch-settings.$branch
>  	fi
>  }
> diff --git a/cri-lock-repos b/cri-lock-repos
> index c8269f3..e75e3f5 100644
> --- a/cri-lock-repos
> +++ b/cri-lock-repos
> @@ -17,7 +17,7 @@
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>  
>  
> -. cri-common
> +. ./cri-common
>  
>  repos=`getrepos`
>  repos_lock="$repos/lock"
> diff --git a/make-distros-flight b/make-distros-flight
> index d407fcb..697a171 100755
> --- a/make-distros-flight
> +++ b/make-distros-flight
> @@ -26,9 +26,9 @@ buildflight=$4
>  
>  flight=`./cs-flight-create $blessing $branch`
>  
> -. cri-common
> -. ap-common
> -. mfi-common
> +. ./cri-common
> +. ./ap-common
> +. ./mfi-common
>  
>  defsuite=`getconfig DebianSuite`
>  defguestsuite=`getconfig GuestDebianSuite`
> diff --git a/make-flight b/make-flight
> index 70c909d..8dc4e64 100755
> --- a/make-flight
> +++ b/make-flight
> @@ -26,10 +26,10 @@ buildflight=$4
>  
>  flight=`./cs-flight-create $blessing $branch`
>  
> -. cri-common
> -. cri-getplatforms
> -. ap-common
> -. mfi-common
> +. ./cri-common
> +. ./cri-getplatforms
> +. ./ap-common
> +. ./mfi-common
>  
>  defsuite=`getconfig DebianSuite`
>  defguestsuite=`getconfig GuestDebianSuite`
> diff --git a/mg-all-branch-statuses b/mg-all-branch-statuses
> index bba7216..74dc09a 100755
> --- a/mg-all-branch-statuses
> +++ b/mg-all-branch-statuses
> @@ -27,7 +27,7 @@
>  
>  set -e
>  
> -. cri-common
> +. ./cri-common
>  
>  mkdir -p tmp
>  
> diff --git a/mg-cpu-microcode-update b/mg-cpu-microcode-update
> index c375a43..4d51dfb 100755
> --- a/mg-cpu-microcode-update
> +++ b/mg-cpu-microcode-update
> @@ -2,8 +2,8 @@
>  
>  set -e
>  
> -. cri-getconfig
> -. mgi-common
> +. ./cri-getconfig
> +. ./mgi-common
>  
>  # iucode_tool is in /usr/sbin, see #788459.
>  export PATH="/usr/local/sbin:$PATH:/sbin:/usr/sbin"
> diff --git a/mg-debian-installer-update b/mg-debian-installer-update
> index 526cdf1..6070b8a 100755
> --- a/mg-debian-installer-update
> +++ b/mg-debian-installer-update
> @@ -21,8 +21,8 @@
>  
>  set -e
>  
> -. cri-getconfig
> -. mgi-common
> +. ./cri-getconfig
> +. ./mgi-common
>  
>  suite=$1
>  arch=$2
> diff --git a/mg-debian-installer-update-all b/mg-debian-installer-update
> -all
> index 241e2e3..1bbaef7 100755
> --- a/mg-debian-installer-update-all
> +++ b/mg-debian-installer-update-all
> @@ -20,7 +20,7 @@
>  
>  set -e
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  suite=`getconfig DebianSuite`
>  fws=`getconfig DebianNonfreeFirmware`
> diff --git a/mg-execute-flight b/mg-execute-flight
> index 7f3d969..0d8c792 100755
> --- a/mg-execute-flight
> +++ b/mg-execute-flight
> @@ -48,7 +48,7 @@ while [ $# != 0 ]; do
>  	esac
>  done
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  if [ x"$flight" = x ]; then badusage; fi
>  
> diff --git a/mg-pxe-loader-update b/mg-pxe-loader-update
> index 386e449..9774350 100755
> --- a/mg-pxe-loader-update
> +++ b/mg-pxe-loader-update
> @@ -23,8 +23,8 @@
>  
>  set -e
>  
> -. cri-getconfig
> -. mgi-common
> +. ./cri-getconfig
> +. ./mgi-common
>  
>  suite=$1
>  
> diff --git a/standalone b/standalone
> index 60b6666..9383d72 100755
> --- a/standalone
> +++ b/standalone
> @@ -123,7 +123,7 @@ while true ; do
>      esac
>  done
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  WebspaceLog=`OSSTEST_CONFIG=$config getconfig WebspaceLog`
>  if [ ! -r "$WebspaceLog" ] ; then
> diff --git a/standalone-reset b/standalone-reset
> index 8555039..0a69915 100755
> --- a/standalone-reset
> +++ b/standalone-reset
> @@ -37,10 +37,10 @@ done
>  shift $((OPTIND-1))
>  
>  if [ -f standalone.config ] ; then
> -    . standalone.config
> +    . ./standalone.config
>  fi
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  jobdb=`getconfig JobDB`
>  if [ "$jobdb" != Standalone ]; then

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OSSTEST PATCH 3/3] Shell fixup: Use bash in posix mode
  2015-09-24 17:29 ` [OSSTEST PATCH 3/3] Shell fixup: Use bash in posix mode Ian Jackson
@ 2015-09-25  8:47   ` Ian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2015-09-25  8:47 UTC (permalink / raw)
  To: Ian Jackson, xen-devel

On Thu, 2015-09-24 at 18:29 +0100, Ian Jackson wrote:
>   I have read through the wheezy
> bash(1) manpage and searched for posix, and the following behavioural
> differences are described:
> 
>  * Differences in interative startup (not relevant to us).
>  * Minor (irrelevant) differences in which startup files are read
>    during noninteractive startup.  (Eg, BASH_ENV not honoured.)
>  * Differences to the parsing of invocations of `time'
>  * `test a == b' may be unsupported (but it's wrong and we say `=')
>  * -e not inherited by some subshells (this is what I am trying to fix)
>  * `.' and `source' do not search the cwd.
>  * `set' with no arguments does not print shell functions etc.

I expected this to also disable "[[ expression ]]", "$((maths))", array
variables and in particular $PIPESTATUS too, but it looks like I was wrong
and it doesn't disable bash _extensions_, just areas where bash differs
from what posix specifies.

Of those we seem to use $((maths)) and $PIPESTATUS (once in the standalone
wrapper), although array variables are tricky to grep for.

I also found http://tiswww.case.edu/php/chet/bash/POSIX (referenced from
the manpage) handy.

> I have done some ad-hoc testing but it seems like much of this is
> difficult to test.  I suggest we push it at a time when we can keep a
> close eye on the behaviour.

Agreed.

> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-25  8:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24 17:29 [OSSTEST PATCH 1/3] Remove obsolete file "test.sched" Ian Jackson
2015-09-24 17:29 ` [OSSTEST PATCH 2/3] Shell fixup: Make all invocations of `.' (`source') use ./ Ian Jackson
2015-09-25  8:40   ` Ian Campbell
2015-09-24 17:29 ` [OSSTEST PATCH 3/3] Shell fixup: Use bash in posix mode Ian Jackson
2015-09-25  8:47   ` Ian Campbell
2015-09-25  8:37 ` [OSSTEST PATCH 1/3] Remove obsolete file "test.sched" Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).