From d24a800adb98d895e82b86afbbd3911f2f758234 Mon Sep 17 00:00:00 2001 From: Mamoru Sakaue / MwGhennndo Date: Sun, 9 Dec 2012 18:47:32 +0900 Subject: [PATCH] [BUG FIX] Error end in case that no packages are installed is fixed. modified: portsreinstall modified: portsreinstall.8 modified: portsreinstall.8~ modified: portsreinstall~ --- portsreinstall | 7 ++++--- portsreinstall.8 | 2 ++ portsreinstall.8~ | 2 +- portsreinstall~ | 7 ++++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/portsreinstall b/portsreinstall index 044954d..c31341e 100755 --- a/portsreinstall +++ b/portsreinstall @@ -10,7 +10,7 @@ # ================================================ APPNAME=`basename "$0"` -MYVERSION=2.0.0+toward_2.0.1_20121209162229 +MYVERSION=2.0.0+toward_2.0.1_20121209183341 PREFIX=${PREFIX:-/usr/local} CONFFILE=${PREFIX}/etc/${APPNAME}.conf @@ -1396,7 +1396,7 @@ show) exit 1 ;; esac - [ -n "${_for_each_matching_port}" -o -r "${DBDIR}/$list" ] || exit 0 + [ -n "${_for_each_matching_port}" -a -r "${DBDIR}/$list" ] || exit 0 [ ! -e "${DBDIR}"/saved_options.sh ] || . "${DBDIR}"/saved_options.sh if [ -n "${_for_each_matching_port}" ] then @@ -2162,7 +2162,7 @@ eof } exit 1 } - cp "${DBDIR}/reinst_order.list.tmp" "${DBDIR}/reinst_order.list" + grep -v '^$' "${DBDIR}/reinst_order.list.tmp" > "${DBDIR}/reinst_order.list" || : touch "${DBDIR}/COMPLETE_ORDERED_ALL_DEPENDENCIES" rm -f "${TMPDIR}/targets" echo @@ -2281,6 +2281,7 @@ fi # Reinstallation of remained ports [ ! -e "${DBDIR}/MODE_REDO" ] || rm -f "${DBDIR}/COMPLETE_REINSTALLATION" "${DBDIR}/COMPLETE_CLEANUP_OBSLETE_DISTFILES" "${DBDIR}/COMPLETE_REBUILD_PKGDB" +[ `cat "${DBDIR}/reinst_order.list" | wc -l` -gt 0 ] || touch "${DBDIR}/COMPLETE_REINSTALLATION" if [ ! -e "${DBDIR}/COMPLETE_REINSTALLATION" ] then _MSG_CURRENT_STAGE_general="reinstallation" diff --git a/portsreinstall.8 b/portsreinstall.8 index 8ad997a..ae46ecc 100644 --- a/portsreinstall.8 +++ b/portsreinstall.8 @@ -291,6 +291,8 @@ Configuration file of portupgrade(1). [BUG FIX] Restoration of backup packages after failed installation was not working correctly. [BUG FIX] The transferring mechanism of option values to restarted run was broken. + +[BUG FIX] Error end in case that no packages are installed is fixed. .TP 2.0.0 (12 August 2012) [NEW] Options \fB\-X\fR, \fB\-r\fR and \fB\-R\fR are added so as to compensate a fact that \fB\-x\fR, \fB\-t\fR and \fB\-T\fR cannot specify package names with commas. diff --git a/portsreinstall.8~ b/portsreinstall.8~ index 83de41f..8ad997a 100644 --- a/portsreinstall.8~ +++ b/portsreinstall.8~ @@ -283,7 +283,7 @@ Configuration file of portupgrade(1). .SH HISTORY \fBportsreinstall\fR has been developed as below. .TP -2.0.1 (08 December 2012) +2.0.1 (09 December 2012) [NEW] New generation package (pkgng) is supported. [IMPROVED] A countermeasure for a build failure in a restarted build from a terminated build is implemented. diff --git a/portsreinstall~ b/portsreinstall~ index de8fd4f..db66a84 100755 --- a/portsreinstall~ +++ b/portsreinstall~ @@ -10,7 +10,7 @@ # ================================================ APPNAME=`basename "$0"` -MYVERSION=2.0.0+toward_2.0.1_20121208064055 +MYVERSION=2.0.0+toward_2.0.1_20121209162229 PREFIX=${PREFIX:-/usr/local} CONFFILE=${PREFIX}/etc/${APPNAME}.conf @@ -1396,7 +1396,7 @@ show) exit 1 ;; esac - [ -n "${_for_each_matching_port}" -o -r "${DBDIR}/$list" ] || exit 0 + [ -n "${_for_each_matching_port}" -a -r "${DBDIR}/$list" ] || exit 0 [ ! -e "${DBDIR}"/saved_options.sh ] || . "${DBDIR}"/saved_options.sh if [ -n "${_for_each_matching_port}" ] then @@ -2162,7 +2162,7 @@ eof } exit 1 } - cp "${DBDIR}/reinst_order.list.tmp" "${DBDIR}/reinst_order.list" + grep -v '^$' "${DBDIR}/reinst_order.list.tmp" > "${DBDIR}/reinst_order.list" || : touch "${DBDIR}/COMPLETE_ORDERED_ALL_DEPENDENCIES" rm -f "${TMPDIR}/targets" echo @@ -2281,6 +2281,7 @@ fi # Reinstallation of remained ports [ ! -e "${DBDIR}/MODE_REDO" ] || rm -f "${DBDIR}/COMPLETE_REINSTALLATION" "${DBDIR}/COMPLETE_CLEANUP_OBSLETE_DISTFILES" "${DBDIR}/COMPLETE_REBUILD_PKGDB" +[ `cat "${DBDIR}/reinst_order.list" | wc -l` -gt 0 ] || touch "${DBDIR}/COMPLETE_REINSTALLATION" if [ ! -e "${DBDIR}/COMPLETE_REINSTALLATION" ] then _MSG_CURRENT_STAGE_general="reinstallation" -- 2.11.0