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.
This commit is contained in:
Hein-Pieter van Braam-Stewart 2021-02-06 00:46:42 +01:00
parent 7d15ccb9f5
commit 7832032e01
1 changed files with 1 additions and 1 deletions

View File

@ -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}"