OSDN Git Service

Termination messages are simplified.
[portsreinstall/current.git] / lib / main / libmain.sh
1 #!/bin/sh -e
2 # ==============================================================================
3 # portsreinstall library script
4 # Overlay onto lib/libmain.sh
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 for special commands =============
11 main_set_termination_messages_special ()
12 {
13         temp_terminate_process ()
14         {
15                 local errno tmp_msg
16                 errno=${1:-0}
17                 tmp_msg=${TMPDIR}/temp_terminate_process:msg
18                 [ $errno -eq 0 -o $opt_batch_mode = yes ] && return
19                 temp_terminate_process_common "$errno"
20                 [ $opt_no_opening_message = yes -o -n "$COMMAND_RESTART" ] && return
21                 cat > $tmp_msg << eof
22 Instead, if you only want to construct the temporary database so as to stop before the actual reinstallation, execute as:
23 ${APPNAME} prepare
24 eof
25                 message_cat "$tmp_msg"
26         }
27 }