Skip to content

Commit

Permalink
Merge pull request #2230 from flatcar/krnowak/drop-python-test-stuff
Browse files Browse the repository at this point in the history
Drop python tests from GCE and Azure OEM images and python sysext
  • Loading branch information
krnowak authored Aug 15, 2024
2 parents d8e282f + 83c4cdc commit 1d141f6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build_library/sysext_mangle_flatcar-python
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ ln -sf /usr/bin/true "${rootfs}/usr/bin/eject"
# both cases, so mangle manually.
mkdir -p "${rootfs}"/usr/lib/systemd/system
cp -a "${rootfs}"/{etc,usr/lib}/systemd/system/.

# Remove test stuff from python - it's quite large.
for p in "${rootfs}"/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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -euo pipefail

rootfs=${1}

# Remove test stuff from python - it's quite large.
for p in "${rootfs}"/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

0 comments on commit 1d141f6

Please sign in to comment.