Bumped to a release version.
Remained bugs in the judgement of conflicts are fixed.
modified: README
modified: bin/portsreinstall
modified: lib/libmessage.sh
modified: lib/libreinstall.sh
modified: man/portsreinstall.8
================================================================================
portsreinstall - ports upgrading utility for massive forced reinstallation
- Version 3.2.1, January 30, 2015
+ Version 3.2.1, January 27, 2015
Copyright (C) 2010-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
================================================================================
# ============ Set up of environment =============
APPNAME=`basename "$0"`
-# MYVERSION=3.2.1
-# COMPATIBLE_VERSIONS='^(3\.[1-2]\.[0-9]+)$'
+MYVERSION=3.2.1
+COMPATIBLE_VERSIONS='^(3\.[1-2]\.[0-9]+)$'
# Template for development versions
-MYVERSION=3.2.0+toward_3.2.1_20150120223451
-COMPATIBLE_VERSIONS='^(3\.[1-2]\.[0-9]+\+toward_3\.[1-2]\.[0-9]+_[0-9]+|3\.[1-2]\.[0-9]+)$'
+# MYVERSION=3.2.0+toward_3.2.1_20150120223451
+# COMPATIBLE_VERSIONS='^(3\.[1-2]\.[0-9]+\+toward_3\.[1-2]\.[0-9]+_[0-9]+|3\.[1-2]\.[0-9]+)$'
MYPREFIX=`dirname "\`dirname \"$0\"\`" | sed 's|/bin$||'`
MYPREFIX=${MYPREFIX:-/usr/local}
LIBDIR=${MYPREFIX}/lib/${APPNAME}
fold -s -w $ncolumns << eof
-- Ports upgrading utility for massive forced reinstallation
-- And for those who are pursuing the perfect packages environment
-Copyright (C) 2010 - 2014 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+Copyright (C) 2010 - 2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
Email: <sakaue.mamoru@samurai.mwghennn.net>
Homepage: <http://www.mwghennndo.com/software/portsreinstall/>
eof
}
# ============= Check whether a package is forbidden due to conflicts =============
+reinstall_quick_chk_forbidden_conflicts ()
+{
+ local pkg pkg_regexp_esc
+ pkg=$1
+ pkg_regexp_esc=`str_escape_regexp "$pkg"`
+ grep -qE "^$pkg_regexp_esc:" "${DBDIR}/forbidden_conflicts"
+}
+
+# ============= Check whether a package is forbidden due to conflicts =============
reinstall_chk_forbidden_conflicts ()
{
- local pkg tmp_forbidden backup_pkg pkg pkg_regexp_esc
+ local pkg tmp_forbidden pkg_regexp_esc
pkg=$1
tmp_forbidden=${TMPDIR}/reinstall_chk_forbidden_conflicts:forbidden
pkg_regexp_esc=`str_escape_regexp "$pkg"`
# ============= Back up and delete remaining actual install conflicts =============
reinstall_backup_and_delete_remaining_install_conflicts ()
{
- local stagedir
+ local stagedir tmp_conflicts
+ tmp_conflicts=${TMPDIR}/reinstall_backup_and_delete_remaining_install_conflicts
message_echo "(Checking installation conflict...)"
stagedir=`database_query_get_makevar_val "$REINSTALL_ORIGIN" STAGEDIR`
{
) | sed 's|^\.||' | while read filepath
do
[ ! -e "$filepath" ] && continue
- pkg=`pkg_which "$filepath"`
+ pkg=`pkg_which "$filepath" || :`
[ -z "$pkg" ] && continue
- origin=`pkg_info_qo "$pkg"`
+ origin=`pkg_info_qo "$pkg" || :`
[ x"$origin" = x"$REINSTALL_ORIGIN" ] || echo "$pkg"
done
pkgsys_get_conflicting_installed_pkgs install "$REINSTALL_ORIGIN"
- } | sort -u | reinstall_backup_and_delete_conflicts
+ } | sort -u > $tmp_conflicts
+ while read pkg_conflict
+ do
+ fileedit_add_a_line_if_new "$pkg_conflict:$REINSTALL_NEWPKGNAME" \
+ "${DBDIR}/forbidden_conflicts"
+ done < $tmp_conflicts
+ reinstall_backup_and_delete_conflicts < $tmp_conflicts
}
# ============= Restoration of backed up conflicts =============
if [ "$origin_bak" = "$REINSTALL_ORIGIN" ]
then
[ "$pkg_bak" = "$REINSTALL_NEWPKGNAME" ] && continue
+ elif reinstall_quick_chk_forbidden_conflicts "$pkg_bak"
+ then
+ continue
elif ! pkgsys_chk_match_to_restored_files_by_backup_pkg "$origin_bak" "${TMPDIR}/previously_installed_files.grep_pattern"
then
continue
.\" ports reinstall installation guide
.\" Copyright (C) 2010-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
.\" ==================================================================================
-.TH PORTSREINSTALL 8 "30 January 2015" "FreeBSD" "FreeBSD System Manager's Manual"
+.TH PORTSREINSTALL 8 "27 January 2015" "FreeBSD" "FreeBSD System Manager's Manual"
.SH NAME
portsreinstall \- ports upgrading utility for massive forced reinstallation
.SH SYNOPSIS
.SH HISTORY
\fBportsreinstall\fR has been developed as below.
.TP
-3.2.1 (30 January 2015)
+3.2.1 (27 January 2015)
.RS
-[BUG FIX] The automatic resolution of installation conflict implemented in the previous version was broken and could have recognized the all packages as conflicts.
+[BUG FIX] The automatic resolution of installation conflict implemented in the previous version was seriously broken and judged conflicts incorrectly.
.RE
.TP
3.2.0 (30 December 2014)