From 0d1c4f95c4c2d2d7c1a01f6a46502b7c49c06647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 12 Mar 2020 08:56:34 +0000 Subject: Reduce awk(1), grep(1), seq(1), and stat(1) usage. subr/build_init.subr:buildp_init_files(): replace timestamp w/ running total log filename suffix. subr/build_init.subr:buildp_init_prereqs(): ensure sed(1) supports -i option. subr/rtl_complex.subr:rtl_{get_cpu_count,is_newer}(): initial implementation. subr/rtl_string.subr:rtl_match(): initial implementation. --- vars/gdk.vars | 2 +- vars/glib.vars | 2 +- vars/python2_host.vars | 2 +- vars/python3_host.vars | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'vars') diff --git a/vars/gdk.vars b/vars/gdk.vars index 0aac8f8a..0274be8c 100644 --- a/vars/gdk.vars +++ b/vars/gdk.vars @@ -8,7 +8,7 @@ enable_gio_sniffing=yes"}; pkg_gdk_install_files_post() { local _pc_path=""; for _pc_path in $(find "${PKG_DESTDIR}"/lib/pkgconfig -name \*.pc); do - if ! sed -i"" -e '/^Requires:\s\+gobject-2.0$/s/^.*$/& gio-2.0/' "${_pc_path}"; then + if ! sed -i"" -e '/^Requires:[[:space:]]*gobject-2.0$/s/^.*$/& gio-2.0/' "${_pc_path}"; then return 1; fi; done; diff --git a/vars/glib.vars b/vars/glib.vars index 55d97500..23b4ca7e 100644 --- a/vars/glib.vars +++ b/vars/glib.vars @@ -13,7 +13,7 @@ glib_cv_uscore=yes"}; pkg_glib_install_files_post() { local _pc_path=""; for _pc_path in $(find "${PKG_DESTDIR}"/lib/pkgconfig -name \*.pc); do - if ! sed -i"" -e '/^Libs:/s/^\(Libs:\s\+-L\${libdir}\)\s\+\(.\+\)$/\1 \2 -lffi -lpcre -lz/' "${_pc_path}"; then + if ! sed -i"" -e '/^Libs:/s/^\(Libs:[[:space:]]*-L\${libdir}\)[[:space:]]*\(.*\)$/\1 \2 -lffi -lpcre -lz/' "${_pc_path}"; then return 1; fi; done; diff --git a/vars/python2_host.vars b/vars/python2_host.vars index 495d0b2f..0338eb61 100644 --- a/vars/python2_host.vars +++ b/vars/python2_host.vars @@ -7,7 +7,7 @@ pkg_python2_host_fetch_download() { || ! rtl_fileop rm "${PKG_BASE_DIR}/sbpython2"\ || ! rtl_fetch_urls_git "${PKG_BASE_DIR}/build" "sbpython2=${DEFAULT_GITROOT}/python/sbpython2@main"\ || ! rtl_fileop cp "../sbpython2/project/config/cfgdefs.sh" "../sbpython2/project/config/cfgdefs.sh.orig"\ - || ! sed -i"" -e"s/-ltinfo/&w/" -e"s/mb_ncurses_libs='\([^']\+\)'/mb_ncurses_libs='\1 -ltinfow'/" ../sbpython2/project/config/cfgdefs.sh\ + || ! sed -i"" -e"s/-ltinfo/&w/" -e"s/mb_ncurses_libs='\([^']*\)'/mb_ncurses_libs='\1 -ltinfow'/" ../sbpython2/project/config/cfgdefs.sh\ || ! sed -i"" -e'108a\ cfgtest_ldflags_append "-L$mb_prefix/lib"' "../sbpython2/project/config/cfgdefs.sh"\ || ! sed -i"" '/^PYCOMPILE_CFLAGS.*+= -std=c99/a\ diff --git a/vars/python3_host.vars b/vars/python3_host.vars index 55ec443a..07fe489f 100644 --- a/vars/python3_host.vars +++ b/vars/python3_host.vars @@ -7,7 +7,7 @@ pkg_python3_host_fetch_download() { || ! rtl_fileop rm "${PKG_BASE_DIR}/sbpython3"\ || ! rtl_fetch_urls_git "${PKG_BASE_DIR}/build" "sbpython3=${DEFAULT_GITROOT}/python/sbpython3@main"\ || ! rtl_fileop cp "../sbpython3/project/config/cfgdefs.sh" "../sbpython3/project/config/cfgdefs.sh.orig"\ - || ! sed -i"" -e"s/-ltinfo/&w/" -e"s/mb_ncurses_libs='\([^']\+\)'/mb_ncurses_libs='\1 -ltinfow'/" "../sbpython3/project/config/cfgdefs.sh"\ + || ! sed -i"" -e"s/-ltinfo/&w/" -e"s/mb_ncurses_libs='\([^']*\)'/mb_ncurses_libs='\1 -ltinfow'/" "../sbpython3/project/config/cfgdefs.sh"\ || ! sed -i"" -e'108a\ cfgtest_ldflags_append "-L$mb_prefix/lib"' "../sbpython3/project/config/cfgdefs.sh"\ || ! sed -i"" '/^PYCOMPILE_CFLAGS.*+= -std=c99/a\ -- cgit v1.2.3