Skip to content

Commit 025ff09

Browse files
committed
[update] : Delete all /var/cache
1 parent c151d36 commit 025ff09

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,17 +306,25 @@ _cleanup_common () {
306306

307307
# Delete pacman database sync cache files (*.tar.gz)
308308
[[ -d "${airootfs_dir}/var/lib/pacman" ]] && find "${airootfs_dir}/var/lib/pacman" -maxdepth 1 -type f -delete
309+
309310
# Delete pacman database sync cache
310311
[[ -d "${airootfs_dir}/var/lib/pacman/sync" ]] && find "${airootfs_dir}/var/lib/pacman/sync" -delete
312+
311313
# Delete pacman package cache
312314
[[ -d "${airootfs_dir}/var/cache/pacman/pkg" ]] && find "${airootfs_dir}/var/cache/pacman/pkg" -type f -delete
315+
313316
# Delete all log files, keeps empty dirs.
314317
[[ -d "${airootfs_dir}/var/log" ]] && find "${airootfs_dir}/var/log" -type f -delete
318+
315319
# Delete all temporary files and dirs
316320
[[ -d "${airootfs_dir}/var/tmp" ]] && find "${airootfs_dir}/var/tmp" -mindepth 1 -delete
321+
317322
# Delete package pacman related files.
318323
find "${build_dir}" \( -name '*.pacnew' -o -name '*.pacsave' -o -name '*.pacorig' \) -delete
319324

325+
# Delete all cache file
326+
[[ -d "${airootfs_dir}/var/cache" ]] && find "${airootfs_dir}/var/cache" -mindepth 1 -delete
327+
320328
# Create an empty /etc/machine-id
321329
printf '' > "${airootfs_dir}/etc/machine-id"
322330

0 commit comments

Comments
 (0)