temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
message_section_title "Reinstallation"
program_exec_restartable_loop_operation reinst_todo
+ [ "x$PROGRAM_STEP_COUNTER_LAST_SKIPPED" = xyes ] && message_stage_title "$PROGRAM_STEP_COUNTER"
reinstall_restore_conflicts
temp_set_msg_current_stage
message_echo
temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
message_section_title "Restoration of unselected obsolete/leaf packages"
program_exec_restartable_loop_operation ports_to_restore
+ [ "x$PROGRAM_STEP_COUNTER_LAST_SKIPPED" = xyes ] && message_stage_title "$PROGRAM_STEP_COUNTER"
temp_set_msg_current_stage
message_echo
}
temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
message_section_title "Deinstallation of unused obsolete/leaf packages"
program_exec_restartable_loop_operation ports_to_delete
+ [ "x$PROGRAM_STEP_COUNTER_LAST_SKIPPED" = xyes ] && message_stage_title "$PROGRAM_STEP_COUNTER"
temp_set_msg_current_stage
message_echo
}
MYVERSION=4.1.0
COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$'
# Template for development versions
- MYVERSION=4.0.0+toward_4.1.0_20180910103620
+ MYVERSION=4.0.0+toward_4.1.0_20180910122552
COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
}
PROGRAM_STEP_PROGRESS= # [Used in _program_exec_restartable_loop_operation__routine] Current progress as the finished number of routine steps
PROGRAM_STEP_COUNTER= # [Used in _program_exec_restartable_loop_operation__routine] Counter string indicating the current progress
PROGRAM_STAGETAG= # [Used in _program_exec_restartable_loop_operation__routine] Current stage tag
+PROGRAM_STEP_COUNTER_LAST_SKIPPED=no # Whether the last iteration was skipped
# ============= Check completion of a stage =============
program_chk_stage_complete ()
[ -e "${DBDIR}/stage.reinit_loop/$stagetag" ]
}
+# ============= Check completion of a loop in a stage =============
+program_chk_stage_loop_complete ()
+{
+ local stagetag
+ stagetag=$1
+ program_chk_stage_complete "$stagetag" && return
+ [ -e "${DBDIR}/stage.reinit_loop/$stagetag" ]
+}
+
# ============= Register completion of a stage =============
program_register_stage_complete ()
{
nlines=`wc -l < ${TMPDIR}/$inputdb.input`
PROGRAM_STEP_PROGRESS=$(($PROGRAM_NUM_STEPS-$nlines))
iline=1
+ PROGRAM_STEP_COUNTER_LAST_SKIPPED=no
while [ $iline -le $nlines ]
do
item=`sed -n ${iline}p "${TMPDIR}/$inputdb.input"`
iline=$(($iline+1))
PROGRAM_STEP_PROGRESS=$(($PROGRAM_STEP_PROGRESS+1))
PROGRAM_STEP_COUNTER="[$PROGRAM_STEP_PROGRESS/$PROGRAM_NUM_STEPS $(($PROGRAM_STEP_PROGRESS*100/$PROGRAM_NUM_STEPS))%]"
- grep -q -Fx "$item" "$looplist.remain" 2> /dev/null || continue
+ if grep -vq -Fx "$item" "$looplist.remain" 2> /dev/null
+ then
+ [ $iline -gt $nlines ] && PROGRAM_STEP_COUNTER_LAST_SKIPPED=yes
+ continue
+ fi
_program_exec_restartable_loop_operation__routine "$item"
fileedit_rm_a_line "$item" "$looplist.remain"
done