[archiso] Rewrite cleanup step in mkarchiso

Currently works partially since in bash "*" is not expanded.
Old dirs removed, always empty dirs removed from list.
Also cleanup sync databases from pacman 3.4.0, avoiding problems with
pacman -Sy since "sync" directory is deleted.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
This commit is contained in:
Gerardo Exequiel Pozzi 2010-06-29 19:45:42 -03:00
parent 6a0333c955
commit 1114731c28

View File

@ -149,13 +149,18 @@ to the iso/ directory.
fi fi
fi fi
# delete a lot of unnecessary cache/log files # Delete pacman database sync cache files (*.tar.gz)
kill_dirs="var/abs var/cache/man var/cache/pacman var/lib/pacman/sync var/log/* var/mail tmp/* initrd" find "${work_dir}/root-image/var/lib/pacman" -maxdepth 1 -type f -delete
for x in ${kill_dirs}; do # Delete pacman database sync cache
if [ -e "${work_dir}/root-image/${x}" ]; then find "${work_dir}/root-image/var/lib/pacman/sync" -delete
rm -rf "${work_dir}/root-image/${x}" # Delete pacman package cache
fi find "${work_dir}/root-image/var/cache/pacman/pkg" -type f -delete
done # Delete all log files, keeps empty dirs.
find "${work_dir}/root-image/var/log" -type f -delete
# Delete all temporary files and dirs
find "${work_dir}/root-image/var/tmp" -mindepth 1 -delete
# Delete all temporary files and dirs
find "${work_dir}/root-image/tmp" -mindepth 1 -delete
fi fi
} }