Remove obsolete file "test.sched"
PATCH 1/3 Remove obsolete file "test.sched"
--- test.sched | 5 ----- 1 file changed, 5 deletions(-) delete mode 100755 test.sched
test.sched deleted +0 -5
@@ -1,5 +0,0 @@ -#!/bin/sh -set -e -./ts-install-debian -./ts-build-prep -./ts-build-xen
Signature · 1 line
1.7.10.4
PATCH 2/3 Shell fixup: Make all invocations of `.' (`source') use ./
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'.
--- 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(-)
ap-fetch-version +3 -3
@@ -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 \
ap-fetch-version-baseline +1 -1
@@ -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}
ap-fetch-version-baseline-late +3 -3
@@ -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
ap-fetch-version-old +3 -3
@@ -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}
ap-print-url +3 -3
@@ -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
ap-push +3 -3
@@ -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
ap-qemu-revision +2 -2
@@ -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 '
ap-qemu-url +2 -2
@@ -21,7 +21,7 @@ set -e xenbranch=$1 -. cri-lock-repos -. ap-common +. ./cri-lock-repos +. ./ap-common echo $TREE_QEMU
cr-all-branch-statuses +1 -1
@@ -18,7 +18,7 @@ set -ex -. cri-args-hostlists +. ./cri-args-hostlists branch=$1; shift check_stop all-branch-statuses.
cr-daily-branch +2 -2
@@ -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 ||:
cr-try-bisect +2 -2
@@ -19,8 +19,8 @@ set -ex -. cri-bisect -. cri-args-hostlists +. ./cri-bisect +. ./cri-args-hostlists branch=$1; shift select_branch
cr-try-bisect-adhoc +3 -3
@@ -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
cri-args-hostlists +3 -3
@@ -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}
cri-common +2 -2
@@ -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 }
cri-lock-repos +1 -1
@@ -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"
make-distros-flight +3 -3
@@ -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`
make-flight +4 -4
@@ -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`
mg-all-branch-statuses +1 -1
@@ -27,7 +27,7 @@ set -e -. cri-common +. ./cri-common mkdir -p tmp
mg-cpu-microcode-update +2 -2
@@ -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"
mg-debian-installer-update +2 -2
@@ -21,8 +21,8 @@ set -e -. cri-getconfig -. mgi-common +. ./cri-getconfig +. ./mgi-common suite=$1 arch=$2
mg-debian-installer-update-all +1 -1
@@ -20,7 +20,7 @@ set -e -. cri-getconfig +. ./cri-getconfig suite=`getconfig DebianSuite` fws=`getconfig DebianNonfreeFirmware`
mg-execute-flight +1 -1
@@ -48,7 +48,7 @@ while [ $# != 0 ]; do esac done -. cri-getconfig +. ./cri-getconfig if [ x"$flight" = x ]; then badusage; fi
mg-pxe-loader-update +2 -2
@@ -23,8 +23,8 @@ set -e -. cri-getconfig -. mgi-common +. ./cri-getconfig +. ./mgi-common suite=$1
standalone +1 -1
@@ -123,7 +123,7 @@ while true ; do esac done -. cri-getconfig +. ./cri-getconfig WebspaceLog=`OSSTEST_CONFIG=$config getconfig WebspaceLog` if [ ! -r "$WebspaceLog" ] ; then
standalone-reset +2 -2
@@ -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
Signature · 1 line
1.7.10.4
Re: [OSSTEST PATCH 2/3] Shell fixup: Make all invocations of `.' (`source') use ./
Quoted 10 lines · Ian Jackson
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.
Quoted 7 lines
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 <[email protected]>
I think there are good reasons for not simply adding . to $PATH at the top of the various scripts.
Quoted 446 lines
--- 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(-)ap-fetch-version +3
-3@@ -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 \ap-fetch-version-baseline +1
-1@@ -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}ap-fetch-version-baseline renamed from ap-fetch-version-baseline-late +0
-1-lateindex ef1a8b1..3db443d 100755
ap-fetch-version-baseline-late +3
-3@@ -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" inap-fetch-version-old +3
-3@@ -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}ap-print-url +3
-3@@ -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_THISap-push +3
-3@@ -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_MAINLINEap-qemu-revision +2
-2@@ -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 'ap-qemu-url +2
-2@@ -21,7 +21,7 @@ set -e xenbranch=$1 -. cri-lock-repos -. ap-common +. ./cri-lock-repos +. ./ap-common echo $TREE_QEMUcr-all-branch-statuses +1
-1@@ -18,7 +18,7 @@ set -ex -. cri-args-hostlists +. ./cri-args-hostlists branch=$1; shift check_stop all-branch-statuses.cr-daily-branch +2
-2@@ -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 ||:cr-try-bisect +2
-2@@ -19,8 +19,8 @@ set -ex -. cri-bisect -. cri-args-hostlists +. ./cri-bisect +. ./cri-args-hostlists branch=$1; shift select_branchcr-try-bisect-adhoc +3
-4@@ -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=adhoccri-args-hostlists +3
-3@@ -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}cri-common +2
-2@@ -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 }cri-lock-repos +1
-1@@ -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"make-distros-flight +3
-3@@ -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`make-flight +4
-4@@ -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`mg-all-branch-statuses +1
-1@@ -27,7 +27,7 @@ set -e -. cri-common +. ./cri-common mkdir -p tmpmg-cpu-microcode-update +2
-2@@ -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"mg-debian-installer-update +2
-2@@ -21,8 +21,8 @@ set -e -. cri-getconfig -. mgi-common +. ./cri-getconfig +. ./mgi-common suite=$1 arch=$2mg-debian-installer-update renamed from mg-debian-installer-update-all +0
-1-allindex 241e2e3..1bbaef7 100755
mg-debian-installer-update-all +1
-1@@ -20,7 +20,7 @@ set -e -. cri-getconfig +. ./cri-getconfig suite=`getconfig DebianSuite` fws=`getconfig DebianNonfreeFirmware`mg-execute-flight +1
-1@@ -48,7 +48,7 @@ while [ $# != 0 ]; do esac done -. cri-getconfig +. ./cri-getconfig if [ x"$flight" = x ]; then badusage; fimg-pxe-loader-update +2
-2@@ -23,8 +23,8 @@ set -e -. cri-getconfig -. mgi-common +. ./cri-getconfig +. ./mgi-common suite=$1standalone +1
-1@@ -123,7 +123,7 @@ while true ; do esac done -. cri-getconfig +. ./cri-getconfig WebspaceLog=`OSSTEST_CONFIG=$config getconfig WebspaceLog` if [ ! -r "$WebspaceLog" ] ; thenstandalone-reset +2
-2@@ -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
PATCH 3/3 Shell fixup: Use bash in posix mode
In reply to Ian JacksonWhen 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.
--- 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(-)
ap-fetch-version +1 -1
@@ -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
ap-fetch-version-baseline +1 -1
@@ -17,7 +17,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -set -e +set -e -o posix branch=$1
ap-fetch-version-baseline-late +1 -1
@@ -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
ap-fetch-version-old +1 -1
@@ -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
ap-print-url +1 -1
@@ -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
ap-push +1 -1
@@ -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
ap-qemu-revision +1 -1
@@ -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
ap-qemu-url +1 -1
@@ -17,7 +17,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -set -e +set -e -o posix xenbranch=$1
cr-all-branch-statuses +1 -1
@@ -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
cr-daily-branch +1 -1
@@ -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
cr-for-branches +1 -1
@@ -20,7 +20,7 @@ -set -e +set -e -o posix export FOR_LOGFILE="$*"
cr-try-bisect +1 -1
@@ -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
cr-try-bisect-adhoc +1 -1
@@ -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
cri-getprevxenbranch +1 -1
@@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -e -o posix xenbranch=$1 p=
invoke-daemon +3 -1
@@ -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
make-distros-flight +1 -1
@@ -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
make-flight +1 -1
@@ -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
mg-adjust-flight-makexrefs +1 -1
@@ -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=''
mg-all-branch-statuses +1 -1
@@ -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
mg-branch-setup +1 -1
@@ -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'; }
mg-cpu-microcode-update +1 -1
@@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -e -o posix . ./cri-getconfig . ./mgi-common
mg-debian-installer-update +1 -1
@@ -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
mg-debian-installer-update-all +1 -1
@@ -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
mg-execute-flight +1 -1
@@ -29,7 +29,7 @@ usage () { cat <<END END } -set -e +set -e -o posix publish=false
mg-pxe-loader-update +1 -1
@@ -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
mg-update-live +1 -1
@@ -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"
sa-forget-flight +1 -1
@@ -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
sa-init-db +1 -1
@@ -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
sg-hg-heads +1 -1
@@ -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`
standalone +1 -1
@@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -e -o posix usage() { cat >&2 <<EOF
standalone-generate-dump-flight-runvars +1 -1
@@ -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
standalone-reset +1 -1
@@ -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
Signature · 1 line
1.7.10.4
Re: [OSSTEST PATCH 3/3] Shell fixup: Use bash in posix mode
Quoted 4 lines · Ian Jackson
I have read through the wheezy
bash(1) manpage and searched for posix, and the following behavioural differences are described:
Quoted 8 lines
* Differences in interative startup (not relevant to us).
* Minor (irrelevant) differences in which startup files are read during noninteractive startup. (Eg,BASH_ENVnot 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)
*.' andsource' 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.
Quoted 3 lines
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.
Quoted 1 line
Signed-off-by Ian Jackson <[email protected]>
Quoted 1 line · Ian Jackson
Signed-off-by Ian Jackson <[email protected]>
(Happily too because it always knackers tab completion for my local test -foo.sh scripts ;-))