OSDN Git Service

[IMPROVED] The automatic resolution of installation conflict is improved to detect...
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 3 Dec 2014 14:28:58 +0000 (23:28 +0900)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 3 Dec 2014 14:28:58 +0000 (23:28 +0900)
(Not tested yet)

modified:   bin/portsreinstall
modified:   lib/libreinstall.sh
modified:   man/portsreinstall.8

bin/portsreinstall
lib/libreinstall.sh
man/portsreinstall.8

index 561088e..7d178c2 100755 (executable)
@@ -15,7 +15,7 @@ APPNAME=`basename "$0"`
 # MYVERSION=3.1.0
 # COMPATIBLE_VERSIONS='^(3\.1\.[0-9]+)$'
 # Template for development versions
-MYVERSION=3.1.0+toward_3.1.1_20141203202946
+MYVERSION=3.1.0+toward_3.1.1_20141203232814
 COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+\+toward_3\.1\.[0-9]+_[0-9]+|3\.0\.[0-9]+\+toward_3\.0\.[0-9]+_[0-9]+|3\.1\.[0-9]+)$'
 MYPREFIX=`dirname "\`dirname \"$0\"\`" | sed 's|/bin$||'`
 MYPREFIX=${MYPREFIX:-/usr/local}
index fac5f0c..35656cd 100644 (file)
@@ -861,6 +861,27 @@ reinstall_exec ()
                reinstall_register_stage_complete BUILD
        fi
        reinstall_deregister_stage in_build
+       if reinstall_chk_stage in_stage
+       then
+               message_echo "(Restarting the previously terminated staging process...)"
+               flag_restarted_stage=yes
+       else
+               reinstall_register_stage in_stage
+               flag_restarted_stage=no
+       fi
+       if ! reinstall_chk_stage_complete STAGE
+       then
+               if ! reinstall_make stage
+               then
+                       reinstall_restore_conflicts "$REINSTALL_ORIGIN"
+                       reinstall_restore_if_temporarily_deinstalled
+                       reinstall_errproc 'STAGE operations'
+                       temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
+                       return
+               fi
+               reinstall_register_stage_complete STAGE
+       fi
+       reinstall_deregister_stage in_stage
        if reinstall_chk_stage in_install
        then
                message_echo "(Restarting the previously terminated installation process...)"
@@ -887,9 +908,20 @@ reinstall_exec ()
                fi
                reinstall_register_stage_complete BEFOREDEINSTALL
        fi
-       pkgsys_get_conflicting_installed_pkgs install "$REINSTALL_ORIGIN" \
-               | reinstall_backup_and_delete_conflicts
        reinstall_deinstall
+       message_echo "(Checking installation conflict...)"
+       stagedir=`database_query_get_makevar_val "$REINSTALL_ORIGIN" STAGEDIR`
+       {
+               ( set -e
+                       cd "$stagedir"
+                       find . -not -type d
+               ) | sed 's|^\.||' | while read filepath
+               do
+                       [ -e "$filepath" ] || continue
+                       pkg_which "$filepath"
+               done
+               pkgsys_get_conflicting_installed_pkgs install "$REINSTALL_ORIGIN"
+       } | sort -u | reinstall_backup_and_delete_conflicts
        if ! reinstall_chk_stage_complete INSTALL
        then
                if ! reinstall_chk_stage FAILED_INSTALL
index 483aacf..cbb61a6 100644 (file)
@@ -933,6 +933,8 @@ Configuration file of \fBportupgrade\fR(1).
 .TP
 3.1.1 (4 December 2014)
 .RS
+[IMPROVED] The automatic resolution of installation conflict is improved to detect actual conflict not described in CONFLICTS or CONFLICTS_INSTALL (for the sake of the staging mechanism).
+.PP
 [BUG FIX] MOVED or REPLACED ports were possibly incorrectly detected as duplicated ports.
 .PP
 [BUG FIX] Command \fBpkgsanity\fR was confused by the specification change of \fBpkg-check\fR(8).