2 # ==============================================================================
3 # portsreinstall-chroot library script
4 # Overlay onto lib/libdatabase_maintain.sh for portsreinstall-chroot
5 # - Operations on the temporary database -
6 # Copyright (C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
7 # This software is distributed under the 2-Clause BSD License.
8 # ==============================================================================
10 # ============= Destroy the builder chroot environment by preserving the option setting =============
11 database_maintain_destroy ()
13 message_echo "Starting to clean up the builder chroot environment..."
14 program_deregister_stage_complete CLEANUP_GUEST
16 message_echo "Starting to reset the temporary database by preserving the option setting..."
17 find "${DBDIR}" -depth 1 -maxdepth 1 \
18 -not \( -name saved_options.sh \
19 -or -name MYVERSION -or -name .lock \) \
20 -exec rm -rf {} \; 2> /dev/null || :
21 touch "${DBDIR}/MYVERSION"
24 # ============= Destroy the builder chroot environment and clean up the temporary database =============
25 database_maintain_clean ()
27 message_echo "Starting to clean up the builder chroot environment..."
29 message_echo "Starting to clean up the temporary database..."
30 command_exec_without_pkgtools__notify_reset_options
34 # ============= Forcibly destroy the builder chroot environment and clean up the temporary database =============
35 database_maintain_clean_force ()
37 [ -e "${DBDIR}/saved_options.sh" ] && . "${DBDIR}/saved_options.sh"
38 database_maintain_clean