From 937be5360303b3144a5a23a55d10a0d3bc266880 Mon Sep 17 00:00:00 2001 From: Mamoru Sakaue / MwGhennndo Date: Thu, 12 Jul 2018 01:46:22 +0800 Subject: [PATCH] [BUG FIX] Conflict was not correctly escaped in package installation. Changes to be committed: modified: lib/libmain.sh modified: lib/libreinstall.sh modified: man/portsreinstall.8 --- lib/libmain.sh | 2 +- lib/libreinstall.sh | 23 +++++++++++++++++++---- man/portsreinstall.8 | 2 ++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/libmain.sh b/lib/libmain.sh index 32a5e90..0c92ffd 100644 --- a/lib/libmain.sh +++ b/lib/libmain.sh @@ -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]+))$' } diff --git a/lib/libreinstall.sh b/lib/libreinstall.sh index 82aac57..5de0826 100644 --- a/lib/libreinstall.sh +++ b/lib/libreinstall.sh @@ -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." diff --git a/man/portsreinstall.8 b/man/portsreinstall.8 index d85cc05..09ca712 100644 --- a/man/portsreinstall.8 +++ b/man/portsreinstall.8 @@ -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) -- 2.11.0