Skip to content

Allow skipping removing certain packages for bloat #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions linuxdeploy-plugin-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ show_usage() {
echo " CONDA_PYTHON_VERSION=\"3.6\""
echo " PIP_REQUIREMENTS=\"packageA packageB -r requirements.txt -e git+https://...\""
echo " PIP_PREFIX=\"AppDir/usr/share/conda\""
echo " BLOAT_REMOVE_SKIP=\"setuptools;pip\""
}

APPDIR=
Expand Down Expand Up @@ -130,6 +131,9 @@ for i in "$APPDIR"/usr/conda/bin/*; do
ln -s -r "$i" "$APPDIR"/usr/bin/
done

# get whitelist of bloat to not remove for this package
IFS=';' read -ra bloatskip <<< "$BLOAT_REMOVE_SKIP"

# remove bloat
pushd "$APPDIR"/usr/conda
rm -rf pkgs
Expand All @@ -140,6 +144,29 @@ rm -rf lib/cmake/
rm -rf include/
rm -rf share/{gtk-,}doc
rm -rf share/man
rm -rf lib/python?.?/site-packages/{setuptools,pip}
rm -rf lib/python?.?/distutils

# remove setuptools unless whitelisted
for entry in "${bloatskip[@]}"; do
if [ "$entry" == "setuptools" ]; then
break
fi
rm -rf lib/python?.?/site-packages/setuptools
done

# remove pip unless whitelisted
for entry in "${bloatskip[@]}"; do
if [ "$entry" == "pip" ]; then
break
fi
rm -rf lib/python?.?/site-packages/pip
done

# remove distutils unless whitelisted
for entry in "${bloatskip[@]}"; do
if [ "$entry" == "distutils" ]; then
break
fi
rm -rf lib/python?.?/distutils
done

popd