# ================================================
APPNAME=`basename "$0"`
-MYVERSION=2.0.0+toward_2.0.1_20121117194301
+MYVERSION=2.0.0+toward_2.0.1_20121118115119
PREFIX=${PREFIX:-/usr/local}
CONFFILE=${PREFIX}/etc/${APPNAME}.conf
newpkg=
fi
currentpkg=`pkg_info -qO "$origin" 2> /dev/null || :`
- pkgtag=$currentpkg
+ if [ -n "$currentpkg" ]
+ then
+ origpkg=$currentpkg
+ else
+ origpkg=`cat "${DBDIR}/requires/$origin/backedup_version" 2> /dev/null || :`
+ fi
+ pkgtag=$origpkg
[ -n "$pkgtag" ] || pkgtag=$newpkg
if [ -z "$pkgtag" ]
then
echo "WARNING: Failed to create the backup package, but ignored by hoping success." >&2
}
cd "${PORTSDIR}/$origin"
+ echo $currentpkg > ${DBDIR}/requires/$origin/backedup_version
touch "${DBDIR}/requires/$origin/status/COMPLETE_PKG_BACKUP"
fi
if [ -n "$currentpkg" -a ! -e "${DBDIR}/requires/$origin/status/COMPLETE_BEFOREDEINSTALL" ]
fi
echo "*** Trying to deinstall by ports to make sure. (This usually ends up with warnings)"
env ${MAKE_ENVS} make deinstall ${MAKE_ARGS} || :
- if [ -n "$currentpkg" ]
+ backedup_version=`cat "${DBDIR}/requires/$origin/backedup_version" 2> /dev/null || :`
+ if [ -n "$backedup_version" ]
then
- echo "*** Restoring the backup..."
- if [ -e "${DBDIR}/backup_failure/$currentpkg.tbz" ]
+ echo "*** Restoring the backup of $backedup_version..."
+ if [ -e "${DBDIR}/backup_failure/$backedup_version.tbz" ]
then
echo "WARNING: No backup exists, gave up." >&2
- elif pkg_add -fF "${DBDIR}/backup_failure/$currentpkg.tbz"
+ elif pkg_add -fF "${DBDIR}/backup_failure/$backedup_version.tbz"
then
:
else
- echo "WARNING: Failed to restore $currentpkg. Note that your system may experience troubles by this error." >&2
+ echo "WARNING: Failed to restore $backedup_version. Note that your system may experience troubles by this error." >&2
fi
fi
touch "${DBDIR}/requires/$origin/status/COMPETE.FAILED_INSTALL.RECOVER"
.SH HISTORY
\fBportsreinstall\fR has been developed as below.
.TP
-2.0.1 (17 November 2012)
+2.0.1 (18 November 2012)
[IMPROVED] A countermeasure for a build failure in a restarted build from a terminated build is implemented.
+
+[BUG FIX] Restoration of backup packages after failed installation was not working correctly.
.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.
.SH HISTORY
\fBportsreinstall\fR has been developed as below.
.TP
+2.0.1 (18 November 2012)
+[IMPROVED] A countermeasure for a build failure in a restarted build from a terminated build is implemented.
+[BUG FIX] Restoration of backup packages after failed installation was not working correctly.
+.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.
# ================================================
APPNAME=`basename "$0"`
-MYVERSION=2.0.0+toward_2.0.1_20121117185829
+MYVERSION=2.0.0+toward_2.0.1_20121118115001
PREFIX=${PREFIX:-/usr/local}
CONFFILE=${PREFIX}/etc/${APPNAME}.conf
newpkg=
fi
currentpkg=`pkg_info -qO "$origin" 2> /dev/null || :`
- pkgtag=$currentpkg
+ if [ -n "$currentpkg" ]
+ then
+ origpkg=$currentpkg
+ else
+ origpkg=`cat "${DBDIR}/requires/$origin/backedup_version" 2> /dev/null || :`
+ fi
+ pkgtag=$origpkg
[ -n "$pkgtag" ] || pkgtag=$newpkg
if [ -z "$pkgtag" ]
then
echo "WARNING: Failed to create the backup package, but ignored by hoping success." >&2
}
cd "${PORTSDIR}/$origin"
+ echo $currentpkg > ${DBDIR}/requires/$origin/backedup_version
touch "${DBDIR}/requires/$origin/status/COMPLETE_PKG_BACKUP"
fi
if [ -n "$currentpkg" -a ! -e "${DBDIR}/requires/$origin/status/COMPLETE_BEFOREDEINSTALL" ]
fi
echo "*** Trying to deinstall by ports to make sure. (This usually ends up with warnings)"
env ${MAKE_ENVS} make deinstall ${MAKE_ARGS} || :
- if [ -n "$currentpkg" ]
+ backedup_version=`cat "${DBDIR}/requires/$origin/backedup_version" 2> /dev/null || :`
+ if [ -n "$backedup_version" ]
then
- echo "*** Restoring the backup..."
- if [ -e "${DBDIR}/backup_failure/$currentpkg.tbz" ]
+ echo "*** Restoring the backup of $backedup_version..."
+ if [ -e "${DBDIR}/backup_failure/$backedup_version.tbz" ]
then
echo "WARNING: No backup exists, gave up." >&2
- elif pkg_add -fF "${DBDIR}/backup_failure/$currentpkg.tbz"
+ elif pkg_add -fF "${DBDIR}/backup_failure/$backedup_version.tbz"
then
:
else
- echo "WARNING: Failed to restore $currentpkg. Note that your system may experience troubles by this error." >&2
+ echo "WARNING: Failed to restore $backedup_version. Note that your system may experience troubles by this error." >&2
fi
fi
touch "${DBDIR}/requires/$origin/status/COMPETE.FAILED_INSTALL.RECOVER"