bootstrap_cache: fix failure condition
during testing i encountered an unexpected error resulting from the following condition: - bootstrap was cached - cache of bootstrap packages was empty (from playing with `lb clean`) - installer was not none|live everything works fine up until the main installer script, which comes to an abrupt halt with an error due to the missing cached bootstrap packages that it wants to copy. this situation is easy to unintentionally create, as i managed to do. here we catch the failure condition, correcting for it. this is done by checking for the missing cached packages when restoring the bootstrap from the cache, and skipping this if the packages were missing, thus forcing the bootstrap to be rebuilt. the packages should then be found within the cache, allowing the installer stage to complete successfully. of course the bootstrap stage will only cache the packages if caching is enabled, but if caching is disabled and installer enabled, the config validation will catch that, reporting that problem. Gbp-Dch: Short
This commit is contained in:
parent
51903da073
commit
647dcb7aed
|
@ -55,6 +55,20 @@ case "${_ACTION}" in
|
||||||
# Removing old chroot
|
# Removing old chroot
|
||||||
rm -rf chroot
|
rm -rf chroot
|
||||||
|
|
||||||
|
# Catch failure condition.
|
||||||
|
# The installer stage, if not 'none' or 'live' needs to copy cached
|
||||||
|
# bootstrap packages, and will error if these do not exist. This
|
||||||
|
# could be the case if bootstrap is cached but the packages were
|
||||||
|
# wiped from the cache. This detects this condition and if it is the
|
||||||
|
# case, ignores the cached bootstrap, forcing it to be rebuilt thus
|
||||||
|
# re-caching the packages.
|
||||||
|
if ! In_list "${LB_DEBIAN_INSTALLER}" live none &&
|
||||||
|
! ls cache/packages.bootstrap/*.deb > /dev/null 2>&1
|
||||||
|
then
|
||||||
|
Echo_message "Cached bootstrap packages required but missing, ignoring cached bootstrap to force rebuild."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Restoring old cache
|
# Restoring old cache
|
||||||
cp -a cache/bootstrap chroot
|
cp -a cache/bootstrap chroot
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue