Using xargs when copying or hardlinking deb files from and to the package cache to avoid hit the shell max command limits (Closes: #691616).

This commit is contained in:
Daniel Baumann 2012-10-27 23:37:35 +02:00
parent 74c6a77e5a
commit ef2b0289d4
1 changed files with 2 additions and 2 deletions

View File

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