ia64/xen-unstable

changeset 13412:dccc51cac027

Make get-fields.sh really get run by bash rather than default /bin/sh.

Also fix some bashisms in the script.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Fri Jan 12 14:53:13 2007 +0000 (2007-01-12)
parents 6a53d3abe7f8
children c71fe03f086f
files xen/include/Makefile xen/tools/get-fields.sh
line diff
     1.1 --- a/xen/include/Makefile	Fri Jan 12 14:51:27 2007 +0000
     1.2 +++ b/xen/include/Makefile	Fri Jan 12 14:53:13 2007 +0000
     1.3 @@ -65,7 +65,7 @@ compat/%.c: public/%.h xlat.lst Makefile
     1.4  compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tools/get-fields.sh Makefile
     1.5  	grep -v '^[	 ]*#' xlat.lst | \
     1.6  	while read what name hdr; do \
     1.7 -		$(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \
     1.8 +		/bin/bash $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \
     1.9  	done >$@.new
    1.10  	mv -f $@.new $@
    1.11  
     2.1 --- a/xen/tools/get-fields.sh	Fri Jan 12 14:51:27 2007 +0000
     2.2 +++ b/xen/tools/get-fields.sh	Fri Jan 12 14:53:13 2007 +0000
     2.3 @@ -111,7 +111,7 @@ for line in sys.stdin.readlines():
     2.4  			case "$token" in
     2.5  			struct|union)
     2.6  				test $level != 2 || fields=" "
     2.7 -				if [ $level == 1 ]
     2.8 +				if [ $level = 1 ]
     2.9  				then
    2.10  					kind=$token
    2.11  					if [ $kind = union ]
    2.12 @@ -126,7 +126,7 @@ for line in sys.stdin.readlines():
    2.13  				;;
    2.14  			"}")
    2.15  				level=$(expr $level - 1) id=
    2.16 -				if [ $level == 1 -a $kind = union ]
    2.17 +				if [ $level = 1 -a $kind = union ]
    2.18  				then
    2.19  					echo " \\"
    2.20  					echo -n "$1}"
    2.21 @@ -148,7 +148,7 @@ for line in sys.stdin.readlines():
    2.22  				arrlvl=$(expr $arrlvl - 1)
    2.23  				;;
    2.24  			COMPAT_HANDLE\(*\))
    2.25 -				if [ $level == 2 -a -z "$id" ]
    2.26 +				if [ $level = 2 -a -z "$id" ]
    2.27  				then
    2.28  					type=${token#COMPAT_HANDLE?}
    2.29  					type=${type%?}
    2.30 @@ -156,7 +156,7 @@ for line in sys.stdin.readlines():
    2.31  				fi
    2.32  				;;
    2.33  			compat_domain_handle_t)
    2.34 -				if [ $level == 2 -a -z "$id" ]
    2.35 +				if [ $level = 2 -a -z "$id" ]
    2.36  				then
    2.37  					array_type=$token
    2.38  				fi
    2.39 @@ -165,7 +165,7 @@ for line in sys.stdin.readlines():
    2.40  				id=$token
    2.41  				;;
    2.42  			[\,\;])
    2.43 -				if [ $level == 2 -a -n "$(echo $id | $SED 's,^_pad[[:digit:]]*,,')" ]
    2.44 +				if [ $level = 2 -a -n "$(echo $id | $SED 's,^_pad[[:digit:]]*,,')" ]
    2.45  				then
    2.46  					if [ $kind = union ]
    2.47  					then
    2.48 @@ -257,7 +257,7 @@ build_body() {
    2.49  			arrlvl=$(expr $arrlvl - 1)
    2.50  			;;
    2.51  		COMPAT_HANDLE\(*\))
    2.52 -			if [ $level == 2 -a -z "$id" ]
    2.53 +			if [ $level = 2 -a -z "$id" ]
    2.54  			then
    2.55  				type=${token#COMPAT_HANDLE?}
    2.56  				type=${type%?}
    2.57 @@ -265,7 +265,7 @@ build_body() {
    2.58  			fi
    2.59  			;;
    2.60  		compat_domain_handle_t)
    2.61 -			if [ $level == 2 -a -z "$id" ]
    2.62 +			if [ $level = 2 -a -z "$id" ]
    2.63  			then
    2.64  				array_type=$token
    2.65  			fi
    2.66 @@ -279,7 +279,7 @@ build_body() {
    2.67  			fi
    2.68  			;;
    2.69  		[\,\;])
    2.70 -			if [ $level == 2 -a -n "$(echo $id | $SED 's,^_pad[[:digit:]]*,,')" ]
    2.71 +			if [ $level = 2 -a -n "$(echo $id | $SED 's,^_pad[[:digit:]]*,,')" ]
    2.72  			then
    2.73  				if [ -z "$array" -a -z "$array_type" ]
    2.74  				then
    2.75 @@ -352,7 +352,7 @@ check_field() {
    2.76  				id=$token
    2.77  				;;
    2.78  			[\,\;])
    2.79 -				if [ $level == 2 -a -n "$(echo $id | $SED 's,^_pad[[:digit:]]*,,')" ]
    2.80 +				if [ $level = 2 -a -n "$(echo $id | $SED 's,^_pad[[:digit:]]*,,')" ]
    2.81  				then
    2.82  					check_field $1 $2 $3.$id "$fields"
    2.83  					test "$token" != ";" || fields= id=
    2.84 @@ -372,11 +372,11 @@ build_check() {
    2.85  	do
    2.86  		case "$token" in
    2.87  		struct|union)
    2.88 -			if [ $level == 1 ]
    2.89 +			if [ $level = 1 ]
    2.90  			then
    2.91  				kind=$token
    2.92  				echo -n "    CHECK_SIZE_($kind, $1)"
    2.93 -			elif [ $level == 2 ]
    2.94 +			elif [ $level = 2 ]
    2.95  			then
    2.96  				fields=" "
    2.97  			fi
    2.98 @@ -397,7 +397,7 @@ build_check() {
    2.99  			test $level != 2 -o $arrlvl != 1 || id=$token
   2.100  			;;
   2.101  		[\,\;])
   2.102 -			if [ $level == 2 -a -n "$(echo $id | $SED 's,^_pad[[:digit:]]*,,')" ]
   2.103 +			if [ $level = 2 -a -n "$(echo $id | $SED 's,^_pad[[:digit:]]*,,')" ]
   2.104  			then
   2.105  				check_field $kind $1 $id "$fields"
   2.106  				test "$token" != ";" || fields= id=