From 9326345a6e4bc882aae4e796447ccbdf16cdd4b5 Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Thu, 11 Mar 2021 08:50:33 +0000 Subject: [PATCH] scripts/unpack: minor cleanup Eliminate use of cat and subshells in patching. The previous code takes the first field of PKG_BUILD, using a space as the delimiter. PKG_BUILD used to be generated using 'ls' at least as of before commit ef8e871d3c1234d2c2a8c2f0d9b2ba822a2ec50e in 2013. Today, PKG_BUILD is a set path, without spaces. Signed-off-by: Ian Leonard --- scripts/unpack | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/unpack b/scripts/unpack index 161fdf4ffb..01bcf57038 100755 --- a/scripts/unpack +++ b/scripts/unpack @@ -191,9 +191,9 @@ if [ -d "${SOURCES}/${PKG_NAME}" -o -d "${PKG_DIR}/sources" ] || pkg_call_exists if [ -f "${i}" ]; then build_msg "CLR_APPLY_PATCH" "APPLY PATCH $(print_color "CLR_PATCH_DESC" "${PATCH_DESC}")" "${i#${ROOT}/}" if grep -qE '^GIT binary patch$|^rename from|^rename to' ${i}; then - cat ${i} | git apply --directory=$(echo "${PKG_BUILD}" | cut -f1 -d\ ) -p1 --verbose --whitespace=nowarn --unsafe-paths >&${VERBOSE_OUT} + git apply --directory="${PKG_BUILD}" -p1 --verbose --whitespace=nowarn --unsafe-paths < ${i} >&${VERBOSE_OUT} else - cat ${i} | patch -d $(echo "${PKG_BUILD}" | cut -f1 -d\ ) -p1 >&${VERBOSE_OUT} + patch -d "${PKG_BUILD}" -p1 < ${i} >&${VERBOSE_OUT} fi fi done @@ -201,7 +201,7 @@ if [ -d "${SOURCES}/${PKG_NAME}" -o -d "${PKG_DIR}/sources" ] || pkg_call_exists pkg_call_exists_opt post_patch && pkg_call fi - if [ ! "${PKG_NAME}" = "configtools" ] ; then + if [ "${PKG_NAME}" != "configtools" ] ; then for config in $(find "${PKG_BUILD}" -name config.guess | sed 's/config.guess//'); do build_msg "CLR_FIXCONFIG" "FIXCONFIG" "${config}"