live-build/functions
Lyndon Brown f27d13de08 make temporary state of installed tools recoverable
some scripts temporarily install packages to accomplish some work before
then removing them. the list of packages installed is kept in memory in a
variable.

a weakness of this design is that if a failure occurs or the user cancels,
and then following this the user re-runs `lb build`, letting it try to
pick up and recover from where it left off, that list of packages that had
been installed is lost, resulting in those packages that were installed
then being a permanent part of the chroot.

here we fix this weakness by backing up the list to a file, which is always
read from on removal. thus in a recovery situation, any packages still
installed from a situation like that just described, will be removed upon
the next use of `Remove_package()`.

this is not perfect, since we are having to wait for opportunistic
execution of the remove function. we need to find a suitable place for the
`Cleanup_temp_packages()` function to be used.

 - doing so in `Init_config_data()` would not be suitable because we don't
   hold the lock when that's run, even if we ignored the hijacking of that
   function for taking such action...
 - doing it in `Exit()` doesn't seem a good fit either.
 - putting it explicitly in every build script just seems a little messy...

perhaps a local exit trap like for removing the lock...?

note that `binary_rootfs` skips running the remove function after installing
tooling, since it just throws the wrapper chroot away, which then leaves the
file around with stale data for the next remove instance to pick up, which
then does not actually remove it because it's not installed. this is not
ideal either... perhaps the optimisation should be removed from that script?

Gbp-Dch: Short
2020-05-05 19:43:15 +01:00
..
aliases.sh fix $@ parameter expansion issues 2020-04-23 09:38:01 +00:00
architectures.sh arches: fix Check_crossarchitectures param passing 2020-05-04 23:22:10 +01:00
arguments.sh fix usage/help/man bugs 2020-05-03 01:38:17 +01:00
breakpoints.sh use local scope for private function vars 2020-03-16 22:10:03 +00:00
cache.sh use local scope for private function vars 2020-03-16 22:10:03 +00:00
chroot.sh chroot: make var local 2020-04-23 15:47:00 +02:00
chroot_bind_path.sh use local scope for private function vars 2020-03-16 22:10:03 +00:00
color.sh amend copyright & licensing blocks 2020-03-11 13:51:19 +00:00
common.sh fix usage/help/man bugs 2020-05-03 01:38:17 +01:00
conffile.sh config: tweak config file loading order 2020-05-02 20:44:02 +01:00
configuration.sh config: improve BIOS/EFI bootloader selection handling 2020-05-04 21:40:13 +01:00
echo.sh tidy up Echo_breakage() 2020-05-02 13:06:17 +01:00
exit.sh improve stagefiles encapsulation 2020-05-02 14:49:45 +01:00
firmwarelists.sh rename LB_ARCHITECTURES to LB_ARCHITECTURE 2020-04-23 15:54:19 +02:00
init.sh extend config validation to all build components 2020-05-04 13:26:19 +01:00
lockfile.sh locks: tidy lock acquisition 2020-03-13 15:37:38 +00:00
losetup.sh Replace 'which' with 'command -v' to test for the existance of an executable 2020-05-01 09:59:11 +00:00
man.sh fix usage/help/man bugs 2020-05-03 01:38:17 +01:00
packagelists.sh fix $@ parameter expansion issues 2020-04-23 09:38:01 +00:00
packages.sh make temporary state of installed tools recoverable 2020-05-05 19:43:15 +01:00
sourcelist.sh archives: explicitly pass along _PASS to Create_apt_sources_list 2020-03-20 11:43:01 +00:00
stagefile.sh improve stagefiles encapsulation 2020-05-02 14:49:45 +01:00
usage.sh Use descriptive parameter names for Usage() 2020-04-23 16:38:59 +02:00
wrapper.sh fix $@ parameter expansion issues 2020-04-23 09:38:01 +00:00