Compatibility with BSD version of `sed'

Rewrite calls to `sed' to remove '-r/--regexp-extended' parameter, which is not
supported by BSD `sed'.
BSD `sed' does implement regular expressions, but enables them with parameter
'-E' which in turn is not officially supported by GNU `sed' - in fact it is
implemented but not documented.

Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
[yann.morin.1998@free.fr: tweak the root-menu hunk]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Clement Chauplannaz 2013-05-08 09:27:06 +02:00 committed by Yann E. MORIN
parent 8ebf80467c
commit edd1050b7e
6 changed files with 8 additions and 10 deletions

View File

@ -2,7 +2,7 @@
set -e
printf "Creating macrodir...\n"
macrodir="$( sed -r -e '/^AC_CONFIG_MACRO_DIR\(\[(.*)\]\)/!d;' \
macrodir="$( sed -e '/^AC_CONFIG_MACRO_DIR(\[\(.*\)\])/!d;' \
-e 's//\1/;' \
configure.ac \
)"

View File

@ -93,9 +93,7 @@ AC_ARG_ENABLE(
[yes], [root_menu=Configuration],
[no], [root_menu=],
[# Escape the $ signs, otherwise they would get munged by make
# Also, append a space at the end, to separate the package
# name from the literal 'Configuration'
root_menu="$( echo "$enableval" |sed -r -e 's/\$/\\$$/g;' )"])])
root_menu="$( echo "$enableval" |sed -e 's/\$/\\$$/g;' )"])])
AC_SUBST([root_menu], [${root_menu=Configuration}])
AC_ARG_ENABLE(

View File

@ -6,8 +6,8 @@ BUILT_SOURCES = images.c images.h
CLEANFILES = images.c images.h
images.c: images.c_orig
$(AM_V_GEN)$(SED) -r -e 's/^static //' $< >$@
$(AM_V_GEN)$(SED) -e 's/^static //' $< >$@
images.h: images.c_orig
$(AM_V_GEN)$(SED) -r -e '/^static (const char \*xpm_(.+)\[\]) = \{/!d; s//extern \1;/' \
$(AM_V_GEN)$(SED) -e '/^static \(const char \*xpm_\(.\{1,\}\)\[\]\) = {/!d; s//extern \1;/' \
$< >$@

View File

@ -20,7 +20,7 @@ k_cset_old=$( head -n 1 .version |awk '{ print $(2); }' )
# Get the kernel version
eval $( head -n 5 "${k_dir}/Makefile" \
|sed -r -e 's/^/K_/; s/"//g; s/ = ?/="/; s/$/"/;' \
|sed -e 's/^/K_/; s/"//g; s/ = \{0,1\}/="/; s/$/"/;' \
)
k_cset="$( cd "${k_dir}"; \
git log -n 1 --pretty='format:%H' \
@ -58,4 +58,4 @@ printf "Synced-up these changes:\n"
"${k_cset_old}..${k_cset}" \
${k_files} \
)|tee -a "scripts/ksync.log" \
|sed -r -e 's/^/ /;'
|sed -e 's/^/ /;'

View File

@ -26,7 +26,7 @@ if [ ${internal} -ne 0 ]; then
fi
k_ver_plain="$( printf "%s" "${k_ver}" \
|sed -r -e 's/-rc.*//;' )"
|sed -e 's/-rc.*//;' )"
case "${kf_ver}" in
git) kf_ver="-$( git rev-parse --short HEAD )"

View File

@ -16,6 +16,6 @@ CLEANFILES = tweak
EXTRA_DIST = tweak.in tweak.in.patch
tweak: tweak.in
$(AM_V_GEN)$(SED) -r -e "s/@CONFIG_@/$(config_prefix)/g" \
$(AM_V_GEN)$(SED) -e "s/@CONFIG_@/$(config_prefix)/g" \
$< >$@
@chmod +x $@