cache: clarify and simplify package cache save/restore
These functions are specific to handling packages stored in the cache, not other files. They are also always used with the same `cache/packages.` prefix to the path. Gbp-Dch: Short Closes: #952916
This commit is contained in:
parent
c1dcc4dd89
commit
055907592c
|
@ -8,9 +8,9 @@
|
|||
## under certain conditions; see COPYING for details.
|
||||
|
||||
|
||||
Restore_cache ()
|
||||
Restore_package_cache ()
|
||||
{
|
||||
DIRECTORY="${1}"
|
||||
DIRECTORY="cache/packages.${1}"
|
||||
|
||||
if [ "${LB_CACHE}" = "true" ] && [ "${LB_CACHE_PACKAGES}" = "true" ]
|
||||
then
|
||||
|
@ -29,9 +29,9 @@ Restore_cache ()
|
|||
fi
|
||||
}
|
||||
|
||||
Save_cache ()
|
||||
Save_package_cache ()
|
||||
{
|
||||
DIRECTORY="${1}"
|
||||
DIRECTORY="cache/packages.${1}"
|
||||
|
||||
if [ "${LB_CACHE}" = "true" ] && [ "${LB_CACHE_PACKAGES}" = "true" ]
|
||||
then
|
||||
|
|
|
@ -48,9 +48,9 @@ Exit ()
|
|||
|
||||
if ls .build/binary* > /dev/null 2>&1
|
||||
then
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
else
|
||||
Save_cache cache/packages.chroot
|
||||
Save_package_cache chroot
|
||||
fi
|
||||
|
||||
return ${VALUE}
|
||||
|
|
|
@ -119,7 +119,7 @@ case "${LIVE_IMAGE_TYPE}" in
|
|||
esac
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -266,7 +266,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
|
|||
rm -f chroot/binary.sh
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -48,7 +48,7 @@ Check_crossarchitectures
|
|||
Check_package chroot /usr/sbin/grub grub-legacy
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -264,7 +264,7 @@ sed -i -e "s#LB_BOOTAPPEND_INSTALL#${LB_BOOTAPPEND_INSTALL}#" -e "s#LB_BOOTAPPEN
|
|||
sed -i -e 's|\ $||g' binary/boot/grub/menu.lst
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -48,7 +48,7 @@ Check_crossarchitectures
|
|||
Check_package chroot /usr/bin/grub-mkimage grub-pc
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -88,7 +88,7 @@ fi
|
|||
cp ${FILES} binary/boot/grub/i386-pc
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -86,7 +86,7 @@ case ${LB_FIRST_BOOTLOADER} in
|
|||
esac
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -352,7 +352,7 @@ fi
|
|||
mv chroot/binary.img ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.img
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -57,7 +57,7 @@ Check_package chroot /usr/bin/xorriso xorriso
|
|||
Check_package chroot /usr/lib/ISOLINUX/isohdpfx.bin isolinux
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -242,7 +242,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
|
|||
esac
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -50,7 +50,7 @@ case "${LB_ARCHITECTURES}" in
|
|||
Check_package chroot /usr/lib/loadlin/loadlin.exe.gz loadlin
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -71,7 +71,7 @@ case "${LB_ARCHITECTURES}" in
|
|||
gunzip -c "${_PREFIX}/usr/share/doc/loadlin/manual.txt.gz" > binary/tools/loadlin.txt
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -73,7 +73,7 @@ case "${LB_MEMTEST}" in
|
|||
esac
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -106,7 +106,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
|
|||
esac
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -58,7 +58,7 @@ then
|
|||
Check_package chroot /usr/bin/grep-aptavail dctrl-tools
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.chroot
|
||||
Restore_package_cache chroot
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -177,7 +177,7 @@ then
|
|||
Remove_package
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.chroot
|
||||
Save_package_cache chroot
|
||||
|
||||
# Creating stage file
|
||||
Create_stagefile .build/binary_package-lists
|
||||
|
|
|
@ -84,7 +84,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
|
|||
Check_package chroot /sbin/mkfs.${LB_CHROOT_FILESYSTEM} e2fsprogs
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -196,7 +196,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
|
|||
esac
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
;;
|
||||
|
||||
jffs2)
|
||||
|
@ -204,7 +204,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
|
|||
Check_package chroot /usr/sbin/mkfs.jffs2 mtd-tools
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -276,7 +276,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
|
|||
esac
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
;;
|
||||
|
||||
plain)
|
||||
|
@ -301,7 +301,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
|
|||
Check_package chroot /usr/share/doc/squashfs-tools squashfs-tools
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -420,7 +420,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
|
|||
chmod 0644 binary/${INITFS}/filesystem.squashfs
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
;;
|
||||
|
||||
none)
|
||||
|
|
|
@ -126,7 +126,7 @@ then
|
|||
fi
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -313,7 +313,7 @@ esac
|
|||
case "${LB_BUILD_WITH_CHROOT}" in
|
||||
true)
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -59,7 +59,7 @@ case "${LB_ARCHITECTURES}" in
|
|||
Check_package chroot /usr/share/win32/win32-loader.exe win32-loader
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -120,7 +120,7 @@ EOF
|
|||
fi
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -52,7 +52,7 @@ Create_lockfile .lock
|
|||
Check_package chroot /usr/bin/zsyncmake zsync
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -121,7 +121,7 @@ done
|
|||
#CHECKSUMS
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
|
@ -46,7 +46,7 @@ Check_lockfile .lock
|
|||
Create_lockfile .lock
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.chroot
|
||||
Restore_package_cache chroot
|
||||
|
||||
# Mount local repository
|
||||
if echo "${LB_PARENT_MIRROR_CHROOT}" | grep -q '^file:/'
|
||||
|
@ -158,7 +158,7 @@ Apt chroot "upgrade"
|
|||
Apt chroot "dist-upgrade"
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.chroot
|
||||
Save_package_cache chroot
|
||||
|
||||
# Creating stage file
|
||||
Create_stagefile .build/bootstrap_archives
|
||||
|
|
|
@ -48,7 +48,7 @@ case "${1}" in
|
|||
Create_lockfile .lock
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.chroot
|
||||
Restore_package_cache chroot
|
||||
|
||||
# Mount local repository
|
||||
if echo "${LB_PARENT_MIRROR_CHROOT}" | grep -q '^file:/'
|
||||
|
@ -315,7 +315,7 @@ case "${1}" in
|
|||
fi
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.chroot
|
||||
Save_package_cache chroot
|
||||
|
||||
# Creating stage file
|
||||
Create_stagefile .build/chroot_archives
|
||||
|
|
|
@ -81,7 +81,7 @@ fi
|
|||
if ls config/hooks/normal/*.chroot config/hooks/live/*.chroot > /dev/null 2>&1
|
||||
then
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.chroot
|
||||
Restore_package_cache chroot
|
||||
|
||||
for HOOK in config/hooks/normal/*.chroot config/hooks/live/*.chroot
|
||||
do
|
||||
|
@ -107,7 +107,7 @@ then
|
|||
done
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.chroot
|
||||
Save_package_cache chroot
|
||||
|
||||
# Creating stage file
|
||||
Create_stagefile .build/chroot_hooks
|
||||
|
|
|
@ -76,7 +76,7 @@ fi
|
|||
if [ -e chroot/root/packages.chroot ] && [ -s chroot/root/packages.chroot ]
|
||||
then
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.chroot
|
||||
Restore_package_cache chroot
|
||||
|
||||
# Installing packages
|
||||
case "${LB_APT}" in
|
||||
|
@ -93,7 +93,7 @@ then
|
|||
rm -f chroot/root/packages.chroot
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.chroot
|
||||
Save_package_cache chroot
|
||||
|
||||
fi
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ fi
|
|||
Check_package chroot /usr/bin/grep-aptavail dctrl-tools
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.chroot
|
||||
Restore_package_cache chroot
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -93,7 +93,7 @@ rm -f chroot/bin/Packages
|
|||
Remove_package
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.chroot
|
||||
Save_package_cache chroot
|
||||
|
||||
# Creating stage file
|
||||
Create_stagefile .build/chroot_package-lists.${_PASS}
|
||||
|
|
|
@ -68,7 +68,7 @@ Check_package host /usr/bin/wget wget
|
|||
Check_package chroot /usr/bin/apt-ftparchive apt-utils
|
||||
|
||||
# Restoring cache
|
||||
Restore_cache cache/packages.binary
|
||||
Restore_package_cache binary
|
||||
|
||||
# Installing depends
|
||||
Install_package
|
||||
|
@ -834,7 +834,7 @@ case "${LB_MODE}" in
|
|||
esac
|
||||
|
||||
# Saving cache
|
||||
Save_cache cache/packages.binary
|
||||
Save_package_cache binary
|
||||
|
||||
# Removing depends
|
||||
Remove_package
|
||||
|
|
Loading…
Reference in New Issue