#!/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.3
+# MYVERSION=3.0.6
# COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+)$'
# Template for development versions
-MYVERSION=3.0.3+toward_3.0.4_20130812154855
+MYVERSION=3.0.5+toward_3.0.6_20140527113705
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}
CONFFILE=${MYPREFIX}/etc/${APPNAME}.conf
PKGTOOLSCONF=${MYPREFIX}/etc/pkgtools.conf
-
# ==================================================
# ========= PARSING OPTIONS AND ARGUMENTS ==========
# ==================================================
# ================== 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 ()
+{
+ [ $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
+}
+
# ============= 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
need_msg=no
rm -rf "${DBDIR}/conf"
mkdir -p "${DBDIR}/conf"
- [ "x`options_get_effective_opt_load_pkgtoolsconf`" != xno -a $opt_batch_mode = no ] \
+ [ "x`options_get_effective_opt_load_pkgtoolsconf 2> /dev/null`" != xno -a $opt_batch_mode = no ] \
&& need_msg=yes
[ $need_msg = yes ] && \
message_section_title "Parsing pkgtools.conf (by using installed portupgrade)"
reinstall_exec ports-mgmt/pkg
reinstall_restore_conflicts
rm -f "${DBDIR}/target_all"
+ temp_set_msg_current_stage
message_echo
}
program_exec_and_record_completion UPGRADE_PKGNG
reinstall_exec ports-mgmt/dialog4ports
reinstall_restore_conflicts
rm -f "${DBDIR}/target_all"
+ temp_set_msg_current_stage
message_echo
}
program_exec_and_record_completion UPGRADE_DIALOG4PORTS
reinstall_exec "$MYPORTORIGIN"
reinstall_restore_conflicts
rm -f "${DBDIR}/target_all"
+ temp_set_msg_current_stage
message_echo
}
program_exec_and_record_completion UPGRADE_SELF
program_exec_and_record_completion LIST_DEINST_PKGS
# Collect entire distfiles list
-if [ $opt_suppress_inspect_entire_distinfo = yes ]
+if [ $opt_inspect_entire_distinfo = yes ]
then
PROGRAM_DEPENDS=''
_program_exec_and_record_completion__operation ()
message_section_title "Reinstallation"
program_exec_restartable_loop_operation reinst_todo
reinstall_restore_conflicts
+ temp_set_msg_current_stage
message_echo
}
program_exec_and_record_completion REINSTALLATION