OSDN Git Service

Fixed a bug that obsolete or moved ports were not inspected. For this purpose, the...
[portsreinstall/current.git] / lib / chroot / libmain.sh
1 #!/bin/sh -e
2 # ==============================================================================
3 # portsreinstall library script
4 # Overlay onto lib/libmain.sh for portsreinstall-chroot
5 # - Common functions of main programs -
6 # Copyright (C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
7 # This software is distributed under the 2-Clause BSD License.
8 # ==============================================================================
9
10 # ============= Set termination messages which should be shown after mounting file systems =============
11 main_inspect_fs_privilege ()
12 {
13         misc_chk_privilege || return 0
14         fs_inspect_fs_privilege
15         message_echo
16         temp_terminate_process ()
17         {
18                 local errno
19                 errno=${1:-0}
20                 fs_chk_unmount > /dev/null || ( fs_unmount ) || :
21                 temp_terminate_process_common "$errno"
22         }
23         [ $TEMP_IN_TRAP = no ] || temp_terminate_process
24 }