gnome-tweaks: remove .pyc files with buildpaths embedded

The python "optimised" .pyc files contain buildpaths. Delete those and
leave the "unoptimised" .pyc files. The difference is very minor, mainly
that optimised bytecode doesn't contain any assert statements.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Ross Burton 2025-11-12 21:02:44 +00:00 committed by Khem Raj
parent cf4755a60d
commit 9e97fa325f
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -25,6 +25,12 @@ SRC_URI += " \
EXTRA_OEMESON = "-Dpython_site_dir=${PYTHON_SITEPACKAGES_DIR}"
# The optimised .pyc files contain buildpaths, delete them and leave the
# normal ones to be packaged.
do_install:append() {
find ${D}${PYTHON_SITEPACKAGES_DIR} -name *.opt*.pyc -delete
}
FILES:${PN} += " \
${datadir}/metainfo \
${PYTHON_SITEPACKAGES_DIR} \