OSDN Git Service

[BUG FIX] Error end in case that no packages are installed is fixed.
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sun, 9 Dec 2012 09:47:32 +0000 (18:47 +0900)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sun, 9 Dec 2012 09:47:32 +0000 (18:47 +0900)
modified:   portsreinstall
modified:   portsreinstall.8
modified:   portsreinstall.8~
modified:   portsreinstall~

portsreinstall
portsreinstall.8
portsreinstall.8~
portsreinstall~

index 044954d..c31341e 100755 (executable)
@@ -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"
index 8ad997a..ae46ecc 100644 (file)
@@ -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.
index 83de41f..8ad997a 100644 (file)
@@ -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.
index de8fd4f..db66a84 100755 (executable)
@@ -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"