Skip to content

Commit d6b7a54

Browse files
committed
Restore_package_cache: Handle existing but empty packages directory
1 parent 5c83874 commit d6b7a54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/cache.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ Restore_package_cache ()
2121
if [ "$(stat --printf %d ${DIRECTORY}/)" = "$(stat --printf %d chroot/var/cache/apt/archives/)" ]
2222
then
2323
# with hardlinks
24-
find "${DIRECTORY}" -name "*.deb" | xargs cp -fl -t chroot/var/cache/apt/archives
24+
find "${DIRECTORY}" -name "*.deb" -print0 | xargs -0 --no-run-if-empty cp -fl -t chroot/var/cache/apt/archives
2525
else
2626
# without hardlinks
27-
find "${DIRECTORY}" -name "*.deb" | xargs cp -t chroot/var/cache/apt/archives
27+
find "${DIRECTORY}" -name "*.deb" -print0 | xargs -0 --no-run-if-empty cp -t chroot/var/cache/apt/archives
2828
fi
2929
fi
3030
fi

0 commit comments

Comments
 (0)