summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-12-12 14:15:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-13 15:18:46 +0000
commit2f85e62b896ef71e616b5645360cb6750fe4514e (patch)
tree4411bad2d4593dbafe59ca76ffec737c65308acf
parent5693f3e15850cdb05bafb178d92df1aa8e196fe9 (diff)
downloadpoky-2f85e62b896ef71e616b5645360cb6750fe4514e.tar.gz
eglibc: remove dependency of eglibc-utils on bash
Adapt a patch from Peter Seebach <peter.seebach@windriver.com> to remove the non-POSIX elements from the tzselect script, and add a separate patch to work around a bug in the current version of busybox's awk command. This replaces the /bin/bash reference in the script header with /bin/sh and thus eliminates the dependency on bash picked up during packaging. Fixes [YOCTO #3551]. (From OE-Core rev: fe19d0e01cb1563cf4735ef250f80af20059103b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/tzselect-awk.patch42
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/tzselect-sh.patch160
-rw-r--r--meta/recipes-core/eglibc/eglibc_2.16.bb4
3 files changed, 205 insertions, 1 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.16/tzselect-awk.patch b/meta/recipes-core/eglibc/eglibc-2.16/tzselect-awk.patch
new file mode 100644
index 0000000000..dc9949bec9
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/tzselect-awk.patch
@@ -0,0 +1,42 @@
1tzselect: workaround bug in busybox awk
2
3busybox's version of awk in version 1.20.2 and lower doesn't support
4escape sequences in conjunction with the -F option. Use -v FS= instead
5as a workaround until the bug is fixed.
6
7Reference:
8https://bugs.busybox.net/show_bug.cgi?id=5126
9
10Upstream-Status: Inappropriate [other]
11
12Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
13
14--- libc/timezone/tzselect.ksh
15+++ libc/timezone/tzselect.ksh
16@@ -208,7 +208,7 @@ while
17 TZ_for_date=$TZ;;
18 *)
19 # Get list of names of countries in the continent or ocean.
20- countries=$($AWK -F'\t' \
21+ countries=$($AWK -v FS="\t" \
22 -v continent="$continent" \
23 -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
24 '
25@@ -252,7 +252,7 @@ while
26
27
28 # Get list of names of time zone rule regions in the country.
29- regions=$($AWK -F'\t' \
30+ regions=$($AWK -v FS="\t" \
31 -v country="$country" \
32 -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
33 '
34@@ -289,7 +289,7 @@ while
35 esac
36
37 # Determine TZ from country and region.
38- TZ=$($AWK -F'\t' \
39+ TZ=$($AWK -v FS="\t" \
40 -v country="$country" \
41 -v region="$region" \
42 -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
diff --git a/meta/recipes-core/eglibc/eglibc-2.16/tzselect-sh.patch b/meta/recipes-core/eglibc/eglibc-2.16/tzselect-sh.patch
new file mode 100644
index 0000000000..c173ae2f84
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/tzselect-sh.patch
@@ -0,0 +1,160 @@
1tzselect: eliminate ksh-dependency
2
3This is an adapted version of a patch originally
4by Peter Seebach <peter.seebach@windriver.com> found here:
5http://www.eglibc.org/archives/patches/msg00671.html
6
7Upstream-Status: Pending
8
9Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
10
11--- libc/timezone/tzselect.ksh
12+++ libc/timezone/tzselect.ksh
13@@ -1,6 +1,6 @@
14-#! @KSH@
15+#!/bin/sh
16
17-VERSION='@(#)tzselect.ksh 8.2'
18+VERSION='@(#)tzselect.sh 8.2'
19 PKGVERSION='@PKGVERSION@'
20 REPORT_BUGS_TO='@REPORT_BUGS_TO@'
21
22@@ -11,19 +11,10 @@ REPORT_BUGS_TO='@REPORT_BUGS_TO@'
23
24 # Porting notes:
25 #
26-# This script requires several features of the Korn shell.
27-# If your host lacks the Korn shell,
28-# you can use either of the following free programs instead:
29+# func_select allows this script to run on shells (such as busybox ash)
30+# which lack the ksh "select" builtin.
31 #
32-# <a href=ftp://ftp.gnu.org/pub/gnu/>
33-# Bourne-Again shell (bash)
34-# </a>
35-#
36-# <a href=ftp://ftp.cs.mun.ca/pub/pdksh/pdksh.tar.gz>
37-# Public domain ksh
38-# </a>
39-#
40-# This script also uses several features of modern awk programs.
41+# This script uses several features of modern awk programs.
42 # If your host lacks awk, or has an old awk that does not conform to Posix.2,
43 # you can use either of the following free programs instead:
44 #
45@@ -35,6 +26,70 @@ REPORT_BUGS_TO='@REPORT_BUGS_TO@'
46 # mawk
47 # </a>
48
49+# Implement ksh-style select in POSIX shell
50+
51+# We need a mostly-portable echo-n.
52+case `echo -n "foo\c"` in
53+*n*c*) func_echo_n() { echo "$*"; } ;;
54+*n*) func_echo_n() { echo "$*\c"; } ;;
55+*) func_echo_n() { echo -n "$*"; } ;;
56+esac
57+
58+# Synopsis: Replace "select foo in list" with "while func_select foo in list"
59+# and this works just like ksh, so far as I know.
60+func_select () {
61+ func_select_args=0
62+ if expr "$1" : "[_a-zA-Z][_a-zA-Z0-9]*$" > /dev/null; then
63+ func_select_var=$1
64+ else
65+ echo >&2 "func_select: '$1' is not a valid variable name."
66+ return 1
67+ fi
68+ shift 1
69+ case $1 in
70+ in) shift 1;;
71+ *) echo >&2 "func_select: usage: func_select var in ... (you must provide
72+arguments)"; return 1;;
73+ esac
74+ case $# in
75+ 0) echo >&2 "func_select: usage: func_select var in ..."; return 1;;
76+ esac
77+ for func_select_arg
78+ do
79+ func_select_args=`expr $func_select_args + 1`
80+ eval func_select_a_$func_select_args=\$func_select_arg
81+ done
82+ REPLY=""
83+ while :
84+ do
85+ if test -z "$REPLY"; then
86+ func_select_i=1
87+ while test $func_select_i -le $func_select_args
88+ do
89+ eval echo "\"\$func_select_i) \$func_select_a_$func_select_i\""
90+ func_select_i=`expr $func_select_i + 1`
91+ done
92+ fi
93+ func_echo_n "${PS3-#? }" >&2
94+ if read REPLY; then
95+ if test -n "${REPLY}"; then
96+ if expr "$REPLY" : '[1-9][0-9]*$' > /dev/null; then
97+ if test "$REPLY" -ge 1 && test "$REPLY" -le $func_select_args; then
98+ eval $func_select_var=\$func_select_a_$REPLY
99+ else
100+ eval $func_select_var=
101+ fi
102+ else
103+ eval $func_select_var=
104+ fi
105+ return 0
106+ fi
107+ else
108+ eval $func_select_var=
109+ return 1
110+ fi
111+ done
112+}
113
114 # Specify default values for environment variables if they are unset.
115 : ${AWK=awk}
116@@ -80,7 +135,7 @@ IFS=$newline
117
118
119 # Work around a bug in bash 1.14.7 and earlier, where $PS3 is sent to stdout.
120-case $(echo 1 | (select x in x; do break; done) 2>/dev/null) in
121+case $(echo 1 | (while func_select x in x; do break; done) 2>/dev/null) in
122 ?*) PS3=
123 esac
124
125@@ -100,7 +155,7 @@ while
126
127 echo >&2 'Please select a continent or ocean.'
128
129- select continent in \
130+ while func_select continent in \
131 Africa \
132 Americas \
133 Antarctica \
134@@ -180,7 +235,7 @@ while
135 case $countries in
136 *"$newline"*)
137 echo >&2 'Please select a country.'
138- select country in $countries
139+ while func_select country in $countries
140 do
141 case $country in
142 '') echo >&2 'Please enter a number in range.';;
143@@ -219,7 +274,7 @@ while
144 *"$newline"*)
145 echo >&2 'Please select one of the following' \
146 'time zone regions.'
147- select region in $regions
148+ while func_select region in $regions
149 do
150 case $region in
151 '') echo >&2 'Please enter a number in range.';;
152@@ -296,7 +351,7 @@ Universal Time is now: $UTdate."
153 echo >&2 "Is the above information OK?"
154
155 ok=
156- select ok in Yes No
157+ while func_select ok in Yes No
158 do
159 case $ok in
160 '') echo >&2 'Please enter 1 for Yes, or 2 for No.';;
diff --git a/meta/recipes-core/eglibc/eglibc_2.16.bb b/meta/recipes-core/eglibc/eglibc_2.16.bb
index e7e15a2044..973be6535f 100644
--- a/meta/recipes-core/eglibc/eglibc_2.16.bb
+++ b/meta/recipes-core/eglibc/eglibc_2.16.bb
@@ -1,7 +1,7 @@
1require eglibc.inc 1require eglibc.inc
2 2
3DEPENDS += "gperf-native kconfig-frontends-native" 3DEPENDS += "gperf-native kconfig-frontends-native"
4PR = "r18" 4PR = "r19"
5 5
6SRC_URI = "http://downloads.yoctoproject.org/releases/eglibc/eglibc-${PV}-svnr21224.tar.bz2 \ 6SRC_URI = "http://downloads.yoctoproject.org/releases/eglibc/eglibc-${PV}-svnr21224.tar.bz2 \
7 file://eglibc-svn-arm-lowlevellock-include-tls.patch \ 7 file://eglibc-svn-arm-lowlevellock-include-tls.patch \
@@ -30,6 +30,8 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/eglibc/eglibc-${PV}-svnr21
30 http://people.linaro.org/~toolchain/openembedded/patches/eglibc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch \ 30 http://people.linaro.org/~toolchain/openembedded/patches/eglibc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch \
31 http://people.linaro.org/~toolchain/openembedded/patches/eglibc/aarch64-0002-Synchronize-with-linux-elf.h.patch \ 31 http://people.linaro.org/~toolchain/openembedded/patches/eglibc/aarch64-0002-Synchronize-with-linux-elf.h.patch \
32 http://people.linaro.org/~toolchain/openembedded/patches/eglibc/aarch64-0003-Adding-AArch64-support-to-elf-elf.h.patch \ 32 http://people.linaro.org/~toolchain/openembedded/patches/eglibc/aarch64-0003-Adding-AArch64-support-to-elf-elf.h.patch \
33 file://tzselect-sh.patch \
34 file://tzselect-awk.patch \
33 " 35 "
34 36
35SRC_URI[md5sum] = "88894fa6e10e58e85fbd8134b8e486a8" 37SRC_URI[md5sum] = "88894fa6e10e58e85fbd8134b8e486a8"