From 7832032e01f8b3d5d1a4623711d70686c4a16418 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam-Stewart Date: Sat, 6 Feb 2021 00:46:42 +0100 Subject: [PATCH] Don't try to modify binary files The mimetype of .pyc and .pyo files is `text/x-bytecode.python` so these get clobbered by `relocate-sdk.sk` leading to a broken python. --- support/misc/relocate-sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/misc/relocate-sdk.sh b/support/misc/relocate-sdk.sh index caabeaa6f6..49afdfec35 100755 --- a/support/misc/relocate-sdk.sh +++ b/support/misc/relocate-sdk.sh @@ -35,7 +35,7 @@ echo "Relocating the buildroot SDK from ${OLDPATH} to ${NEWPATH} ..." # Make sure file uses the right language export LC_ALL=C # Replace the old path with the new one in all text files -grep -lr "${OLDPATH}" . | while read -r FILE ; do +grep -Ilr "${OLDPATH}" . | while read -r FILE ; do if file -b --mime-type "${FILE}" | grep -q '^text/' && [ "${FILE}" != "${LOCFILE}" ] then sed -i "s|${OLDPATH}|${NEWPATH}|g" "${FILE}"