#!/bin/sh -e
# ==================================================================================
# portsreinstall main script
-# Copyright (C) 2010-2013 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2010-2014 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==================================================================================
# ============ Set up of environment =============
APPNAME=`basename "$0"`
-MYVERSION=3.0.4
-COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+)$'
+# MYVERSION=3.0.6
+# COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+)$'
# Template for development versions
-# MYVERSION=3.0.3+toward_3.0.4_20131115074959
-# COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+\+toward_3\.0\.[0-9]+_[0-9]+|3\.0\.[0-9]+)$'
+MYVERSION=3.0.5+toward_3.0.6_20140531202509
+COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+\+toward_3\.0\.[0-9]+_[0-9]+|3\.0\.[0-9]+)$'
MYPREFIX=`dirname "\`dirname \"$0\"\`" | sed 's|/bin$||'`
MYPREFIX=${MYPREFIX:-/usr/local}
LIBDIR=${MYPREFIX}/lib/${APPNAME}
misc_init_vardefs
temp_trap_init
-conf_setup_envs
DBDIR=/var/tmp/${APPNAME}.db
CONFFILE=${MYPREFIX}/etc/${APPNAME}.conf
PKGTOOLSCONF=${MYPREFIX}/etc/pkgtools.conf
-
# ==================================================
# ========= PARSING OPTIONS AND ARGUMENTS ==========
# ==================================================
exit
fi
+# ============= Set up variables for environment of ports and packages =============
+conf_setup_ports_envs
+conf_setup_packages_envs
+
# ============= Execute command operations before getting the temporary database ready =============
command_exec_before_db_creation "$@"
# ================== TOOLS SET UP ==================
# ==================================================
+# ============= Termination messages during construction of the temporary database =============
+
+# Set termination messages
+temp_terminate_process_common ()
+{
+ local msg_where
+ [ $opt_batch_mode = yes ] && return
+ msg_where=`temp_get_msg_current_stage`
+ [ -n "$msg_where" ] && msg_where=" during $msg_where"
+ echo
+ if [ $errno -eq 130 ]
+ then
+ echo "INFO: Terminated at `message_timestamp`$msg_where."
+ echo
+ echo " You can restart this process from the terminated point by"
+ else
+ echo "INFO: Aborted at `message_timestamp`$msg_where."
+ echo
+ echo " You may restart this process from the aborted point by"
+ fi
+ echo "executing without options or arguments as:"
+ if [ -n "$COMMAND_RESTART" ]
+ then
+ echo " ${APPNAME} $COMMAND_RESTART"
+ else
+ echo " ${APPNAME}"
+ fi
+}
+
+temp_terminate_process ()
+{
+ local tmp_msg
+ tmp_msg=${TMPDIR}/temp_terminate_process:msg
+ [ $errno -eq 0 -o $opt_batch_mode = yes ] && return
+ temp_terminate_process_common
+ [ -n "$COMMAND_RESTART" ] && return
+ cat > $tmp_msg << eof
+ Instead, if you only want to construct the temporary database so as to stop before the actual reinstallation, execute as:
+ ${APPNAME} prepare
+eof
+ message_cat "$tmp_msg"
+}
+
# ============= Opening title =============
message_credit
message_echo
fi
-# ============= Termination messages during construction of the temporary database =============
-
-# Set termination messages
-temp_terminate_process_common ()
-{
- local msg_where
- [ $opt_batch_mode = yes ] && return
- msg_where=`temp_get_msg_current_stage`
- [ -n "$msg_where" ] && msg_where=" during $msg_where"
- echo
- if [ $errno -eq 130 ]
- then
- echo "INFO: Terminated at `message_timestamp`$msg_where."
- echo
- echo " You can restart this process from the terminated point by"
- else
- echo "INFO: Aborted at `message_timestamp`$msg_where."
- echo
- echo " You may restart this process from the aborted point by"
- fi
- echo "executing without options or arguments as:"
- if [ -n "$COMMAND_RESTART" ]
- then
- echo " ${APPNAME} $COMMAND_RESTART"
- else
- echo " ${APPNAME}"
- fi
-}
-
-temp_terminate_process ()
-{
- [ $errno -eq 0 -o $opt_batch_mode = yes ] && return
- temp_terminate_process_common
- [ -n "$COMMAND_RESTART" ] || message_cat 3<< eof
- Instead, if you only want to construct the temporary database so as to stop before the actual reinstallation, execute as:
- ${APPNAME} prepare
-eof
-}
-
# ============= Configurations =============
# Save the previous configuration if exists