3 ## live-build(7) - System Build Scripts
4 ## Copyright (C) 2006-2014 Daniel Baumann <mail@daniel-baumann.ch>
6 ## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7 ## This is free software, and you are welcome to redistribute it
8 ## under certain conditions; see COPYING for details.
15 if [ "${LB_CACHE}" = "true" ] && [ "${LB_CACHE_PACKAGES}" = "true" ]
17 if [ -e "${DIRECTORY}" ]
20 if [ "$(stat --printf %d ${DIRECTORY})" = "$(stat --printf %d chroot/var/cache/apt/archives)" ]
23 find "${DIRECTORY}" -name "*.deb" |
xargs cp -fl -t chroot
/var
/cache
/apt
/archives
26 find "${DIRECTORY}" -name "*.deb" |
xargs cp -t chroot
/var
/cache
/apt
/archives
36 if [ "${LB_CACHE}" = "true" ] && [ "${LB_CACHE_PACKAGES}" = "true" ]
38 # Cleaning current cache
39 # In case of interrupted or incomplete builds, this may return an error,
40 # but we still do want to save the cache.
41 Chroot chroot
"apt-get autoclean" || true
43 if ls chroot
/var
/cache
/apt
/archives
/*.deb
> /dev
/null
2>&1
45 # Creating cache directory
46 mkdir
-p "${DIRECTORY}"
49 for PACKAGE
in chroot
/var
/cache
/apt
/archives
/*.deb
51 if [ -e "${DIRECTORY}"/"$(basename ${PACKAGE})" ]
55 mv "${PACKAGE}" "${DIRECTORY}"
60 # Purging current cache
61 rm -f chroot
/var
/cache
/apt
/archives
/*.deb