OSDN Git Service

[BUG FIX] Conflict was not correctly escaped in package installation.
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 11 Jul 2018 17:46:22 +0000 (01:46 +0800)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 11 Jul 2018 17:46:22 +0000 (01:46 +0800)
 Changes to be committed:
modified:   lib/libmain.sh
modified:   lib/libreinstall.sh
modified:   man/portsreinstall.8

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

index 32a5e90..0c92ffd 100644 (file)
@@ -12,7 +12,7 @@ main_set_version ()
        MYVERSION=4.0.1
        COMPATIBLE_VERSIONS='^(4\.[0]\.[0-1])$'
        # Template for development versions
-       MYVERSION=4.0.0+toward_4.0.1_20180712004109
+       MYVERSION=4.0.0+toward_4.0.1_20180712014559
        COMPATIBLE_VERSIONS='^(4\.[0]\.[0]|4\.[0]\.[0]+(|\+toward_4\.[0]\.[1]+_[0-9]+))$'
 }
 
index 82aac57..5de0826 100644 (file)
@@ -276,7 +276,23 @@ reinstall_backup_and_delete_conflicts ()
        mv "${DBDIR}/deleted_conflicts.tmp" "${DBDIR}/deleted_conflicts"
 }
 
-# ============= Back up and delete remaining actual install conflict =============
+# ============= Back up and delete remaining actual install conflict (for installation by package) =============
+reinstall_backup_and_delete_remaining_install_conflicts__by_pkg ()
+{
+       local pkg tmp_conflicts
+       pkg=$1
+       tmp_conflicts=${TMPDIR}/reinstall_backup_and_delete_remaining_install_conflicts__by_pkg
+       message_echo "(Checking installation conflict...)"
+       pkgsys_get_conflicting_installed_pkgs install "$REINSTALL_ORIGIN" > $tmp_conflicts.pkgs || :
+       while read pkg_conflict
+       do
+               fileedit_add_a_line_if_new "$pkg_conflict:$REINSTALL_ORIGIN:$pkg" \
+                       "${DBDIR}/forbidden_conflicts"
+       done < $tmp_conflicts.pkgs
+       reinstall_backup_and_delete_conflicts < $tmp_conflicts.pkgs
+}
+
+# ============= Back up and delete remaining actual install conflict (for installation by port) =============
 reinstall_backup_and_delete_remaining_install_conflicts ()
 {
        local stagedir tmp_conflicts db_conflict
@@ -978,8 +994,7 @@ reinstall_exec ()
                                                then
                                                        message_fetch_only
                                                else
-                                                       pkgsys_get_conflicting_installed_pkgs install "$REINSTALL_ORIGIN" \
-                                                               | reinstall_backup_and_delete_conflicts
+                                                       reinstall_backup_and_delete_remaining_install_conflicts__by_pkg "$pkg"
                                                        reinstall_pkg_backup || :
                                                        reinstall_register_stage in_add_pkg
                                                        reinstall_deinstall_old_ports
@@ -1057,7 +1072,7 @@ reinstall_exec ()
                message_echo "INFO: The latest repository version $pkg will be installed."
                reinstall_deinstall_old_ports
                reinstall_deinstall
-               reinstall_backup_and_delete_remaining_install_conflicts
+               reinstall_backup_and_delete_remaining_install_conflicts__by_pkg "$pkg"
                if pkg_inst_remote "$pkg"
                then
                        message_echo "INFO: Deemed success."
index d85cc05..09ca712 100644 (file)
@@ -1094,6 +1094,8 @@ Configuration file of \fBportupgrade\fR(1).
 [BUG FIX] Evaluation of old origins was incomplete for merged ports and resulted in redundant detection of conflict.
 .PP
 [BUG FIX] Failure in unmounting of file systems by \fBportsreinstall\-chroot\fR(8) left the privilege lock.
+.PP
+[BUG FIX] Conflict was not correctly escaped in package installation.
 .RE
 .TP
 4.0.0 (29 June 2018)