From 83c4cdcf4479a5b1ef69cb6a42d298ffca6e72ec Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 14 Aug 2024 17:25:28 +0200 Subject: [PATCH] build_library: Shrink the sysext-python image by removing python tests Do the same thing we did for GCE and Azure. --- build_library/sysext_mangle_flatcar-python | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build_library/sysext_mangle_flatcar-python b/build_library/sysext_mangle_flatcar-python index 47dc37e2e1..6ac2f2a018 100755 --- a/build_library/sysext_mangle_flatcar-python +++ b/build_library/sysext_mangle_flatcar-python @@ -7,4 +7,14 @@ pushd "${rootfs}" rm -rf ./usr/{lib/debug,share,include,lib64/pkgconfig} +# Remove test stuff from python - it's quite large. +for p in ./usr/lib/python*; do + if [[ ! -d ${p} ]]; then + continue + fi + # find directories named tests or test and remove them (-prune + # avoids searching below those directories) + find "${p}" \( -name tests -o -name test \) -type d -prune -exec rm -rf '{}' '+' +done + popd