Adjusting Save_cache(); to skip already cached .deb files and only copying new packages to it.
This commit is contained in:
parent
ac27ecc2e0
commit
7be45011f7
|
@ -45,14 +45,15 @@ Save_cache ()
|
||||||
mkdir -p "${DIRECTORY}"
|
mkdir -p "${DIRECTORY}"
|
||||||
|
|
||||||
# Saving new cache
|
# Saving new cache
|
||||||
if [ "$(stat --printf %d ${DIRECTORY})" = "$(stat --printf %d chroot/var/cache/apt/archives)" ]
|
for PACKAGE in chroot/var/cache/apt/archives/*.deb
|
||||||
|
do
|
||||||
|
if [ -e "${DIRECTORY}"/"$(basename ${PACKAGE})" ]
|
||||||
then
|
then
|
||||||
# with hardlinks
|
rm -f "${PACKAGE}"
|
||||||
cp -fl chroot/var/cache/apt/archives/*.deb "${DIRECTORY}"
|
|
||||||
else
|
else
|
||||||
# without hardlinks
|
mv "${PACKAGE}" "${DIRECTORY}"
|
||||||
mv -f chroot/var/cache/apt/archives/*.deb "${DIRECTORY}"
|
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Purging current cache
|
# Purging current cache
|
||||||
|
|
Loading…
Reference in New Issue