~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

Viewing changes to tests/util/grub-shell-tester.in

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-09-13 18:02:04 UTC
  • mfrom: (1.17.15 upstream)
  • mto: (17.6.27 experimental)
  • mto: This revision was merged to the branch mainline in revision 145.
  • Revision ID: package-import@ubuntu.com-20120913180204-mojnmocbimlom4im
Tags: upstream-2.00
ImportĀ upstreamĀ versionĀ 2.00

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh -e
 
1
#! /bin/sh
 
2
set -e
2
3
 
3
4
# Compares GRUB script output with BASH output.
4
5
# Copyright (C) 2009,2010  Free Software Foundation, Inc.
19
20
# Initialize some variables.
20
21
transform="@program_transform_name@"
21
22
 
22
 
prefix=@prefix@
23
 
exec_prefix=@exec_prefix@
24
 
bindir=@bindir@
25
 
libdir=@libdir@
26
 
builddir=@builddir@
 
23
prefix="@prefix@"
 
24
exec_prefix="@exec_prefix@"
 
25
datarootdir="@datarootdir@"
 
26
builddir="@builddir@"
27
27
PACKAGE_NAME=@PACKAGE_NAME@
28
28
PACKAGE_TARNAME=@PACKAGE_TARNAME@
29
29
PACKAGE_VERSION=@PACKAGE_VERSION@
30
 
target_cpu=@target_cpu@
31
30
 
32
31
# Force build directory components
33
 
PATH=${builddir}:$PATH
 
32
PATH="${builddir}:$PATH"
34
33
export PATH
35
34
 
36
35
# Usage: usage
85
84
if [ "x${source}" = x ] ; then
86
85
  tmpfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
87
86
  while read REPLY; do
88
 
    echo $REPLY >> ${tmpfile}
 
87
    echo $REPLY >> "${tmpfile}"
89
88
  done
90
 
  source=${tmpfile}
 
89
  source="${tmpfile}"
91
90
fi
92
91
 
93
92
outfile1=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
94
 
@builddir@/grub-shell --qemu-opts="${qemuopts}" --modules=${modules} ${source} >${outfile1}
 
93
"@builddir@/grub-shell" --qemu-opts="${qemuopts}" --modules=${modules} "${source}" >"${outfile1}"
95
94
 
96
95
outfile2=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
97
 
bash ${source} >${outfile2}
 
96
bash "${source}" >"${outfile2}"
98
97
 
99
 
if ! diff -q ${outfile1} ${outfile2} >/dev/null
 
98
if ! diff -q "${outfile1}" "${outfile2}" >/dev/null
100
99
then
101
100
  echo "${source}: GRUB and BASH outputs did not match (see diff -u ${outfile1} ${outfile2})"
102
101
  status=1
103
102
else
104
 
    rm -f ${outfile1} ${outfile2}
 
103
    rm -f "${outfile1}" "${outfile2}"
105
104
fi
106
105
 
107
106
exit $status