Skip to content

Commit

Permalink
update cleanup scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Yutaka Kondo <[email protected]>
  • Loading branch information
youtalk committed Nov 28, 2024
1 parent 897faaf commit 379e3aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions docker/scripts/cleanup_apt.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

function cleanup_apt() {
local remove_var_lib_apt_lists=$1
apt-get autoremove -y && rm -rf "$HOME"/.cache
if [[ $remove_var_lib_apt_lists == true ]]; then
rm -rf /var/lib/apt/lists/*
local apt_clean=$1
apt-get autoremove -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
if [[ $apt_clean == true ]]; then
apt-get clean
fi
}

Expand Down
6 changes: 3 additions & 3 deletions docker/scripts/cleanup_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ function cleanup_system() {
local lib_dir=$1
local ros_distro=$2

apt-get autoremove -y && rm -rf "$HOME"/.cache &&
find /usr/lib/"$lib_dir"-linux-gnu -name "*.a" -type f -delete &&
find /usr/lib/"$lib_dir"-linux-gnu -name "*.a" -type f -delete &&
find / -name "*.o" -type f -delete &&
find / -name "*.h" -type f -delete &&
find / -name "*.hpp" -type f -delete &&
rm -rf /autoware/ansible /autoware/ansible-galaxy-requirements.yaml /autoware/setup-dev-env.sh /autoware/*.env \
/root/.local/pipx /opt/ros/"$ros_distro"/include /etc/apt/sources.list.d/cuda*.list \
/root/.local/pipx /opt/ros/"$ros_distro"/include /opt/autoware/include /etc/apt/sources.list.d/cuda*.list \
/etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/nvidia-docker.list \
/usr/include /usr/share/doc /usr/lib/gcc /usr/lib/jvm /usr/lib/llvm*
}

./cleanup_apt.sh
cleanup_system "$@"

0 comments on commit 379e3aa

Please sign in to comment.