diff options
author | Daniel Baumann <daniel@debian.org> | 2008-04-19 17:39:44 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2008-04-19 17:39:44 +0200 |
commit | 5bc25fd2eb9e3cad686b38e36f6cbc17782b56eb (patch) | |
tree | 6d91d7bde7c43125be0ce79e2f00c90aa7ea8bb4 | |
parent | ef8df9bcadc48935f709453c086d7aba04f35d84 (diff) | |
download | vyos-live-build-5bc25fd2eb9e3cad686b38e36f6cbc17782b56eb.tar.gz vyos-live-build-5bc25fd2eb9e3cad686b38e36f6cbc17782b56eb.zip |
Adjusting Save_cache(); to skip already cached .deb files and only copying new packages to it.
-rwxr-xr-x | functions/cache.sh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/functions/cache.sh b/functions/cache.sh index 5493471a6..9e70f2c92 100755 --- a/functions/cache.sh +++ b/functions/cache.sh @@ -45,14 +45,15 @@ Save_cache () mkdir -p "${DIRECTORY}" # Saving new cache - if [ "$(stat --printf %d ${DIRECTORY})" = "$(stat --printf %d chroot/var/cache/apt/archives)" ] - then - # with hardlinks - cp -fl chroot/var/cache/apt/archives/*.deb "${DIRECTORY}" - else - # without hardlinks - mv -f chroot/var/cache/apt/archives/*.deb "${DIRECTORY}" - fi + for PACKAGE in chroot/var/cache/apt/archives/*.deb + do + if [ -e "${DIRECTORY}"/"$(basename ${PACKAGE})" ] + then + rm -f "${PACKAGE}" + else + mv "${PACKAGE}" "${DIRECTORY}" + fi + done fi else # Purging current cache |