Restore_package_cache: Handle existing but empty packages directory

This commit is contained in:
Ryan Finnie 2021-02-04 12:37:46 -08:00
parent 5c838744d6
commit d6b7a54831
No known key found for this signature in database
GPG Key ID: 7E60A3A686AE8D98
1 changed files with 2 additions and 2 deletions

View File

@ -21,10 +21,10 @@ Restore_package_cache ()
if [ "$(stat --printf %d ${DIRECTORY}/)" = "$(stat --printf %d chroot/var/cache/apt/archives/)" ] if [ "$(stat --printf %d ${DIRECTORY}/)" = "$(stat --printf %d chroot/var/cache/apt/archives/)" ]
then then
# with hardlinks # with hardlinks
find "${DIRECTORY}" -name "*.deb" | xargs cp -fl -t chroot/var/cache/apt/archives find "${DIRECTORY}" -name "*.deb" -print0 | xargs -0 --no-run-if-empty cp -fl -t chroot/var/cache/apt/archives
else else
# without hardlinks # without hardlinks
find "${DIRECTORY}" -name "*.deb" | xargs cp -t chroot/var/cache/apt/archives find "${DIRECTORY}" -name "*.deb" -print0 | xargs -0 --no-run-if-empty cp -t chroot/var/cache/apt/archives
fi fi
fi fi
fi fi