This is for active development.
New funtionalities are to be added actively.
Revision | 802e6293b38ca05a3d2e4309b8e3a7a951e891d3 (tree) |
---|---|
Time | 2022-04-13 07:56:59 |
Author | ![]() |
Commiter | Mamoru Sakaue |
[BUG FIX] Packages of the same origin with different flavors were not processed correctly.
modified: HISTORY
modified: lib/libcommand_do.sh
modified: lib/libcommand_pkgs.sh
modified: lib/libdatabase_build.sh
modified: lib/libpkgsys.sh
modified: lib/libreinstall.sh
@@ -6,6 +6,7 @@ | ||
6 | 6 | [BUG FIX] Restarted runs failed if paths set to option values or their parent paths are symbolic links. |
7 | 7 | [BUG FIX] The mount command of portsreinstall-chroot(8) failed to detect mounted and unmounted file systems on mount points under symbolic links. |
8 | 8 | [BUG FIX] Command reselect ended up with "missing argument" error. |
9 | +[BUG FIX] Packages of the same origin with different flavors were not processed correctly. | |
9 | 10 | 4.1.0 (22 September 2018) |
10 | 11 | [NEW] Options -j and -x are added. |
11 | 12 | [NEW] Option -J is added to the all utilities. |
@@ -38,7 +39,7 @@ | ||
38 | 39 | [BUG FIX] Failure in unmounting of file systems by portsreinstall-chroot(8) left the privilege lock. |
39 | 40 | [BUG FIX] Conflict was not correctly escaped in package installation. |
40 | 41 | [BUG FIX] Evaluation of globs was incorrect for the regular expression form. |
41 | -[BUG FIX] Flavored requirements were incorrectly inspected. This also caused disability of the use of default packages for flavord ports with the default configuration. | |
42 | +[BUG FIX] Flavored requirements were incorrectly inspected. This also caused disability of the use of default packages for flavored ports with the default configuration. | |
42 | 43 | [BUG FIX] The message about the evaluated dependency level in show command was wrong. |
43 | 44 | [BUG FIX] Unselected leaf ports were skipped in (re)installtion. |
44 | 45 | [BUG FIX] Some upgrading operations by portsreinstall-upgrade(8) were imperfect. |
@@ -224,7 +224,7 @@ command_do_reset_changed_portdb () | ||
224 | 224 | { |
225 | 225 | local tmp_ls |
226 | 226 | program_chk_stage_complete INSPECT_DEPENDENTS || return |
227 | - pkgsys_exists_saved_port_oprions_timestamps || return | |
227 | + pkgsys_exists_saved_port_options_timestamps || return | |
228 | 228 | message_section_title "Inspecting changes of port options" |
229 | 229 | tmp_ls=${TMPDIR}/command_do_reset_changed_portdb |
230 | 230 | rm -f "$tmp_ls.updated" |
@@ -232,9 +232,9 @@ command_do_reset_changed_portdb () | ||
232 | 232 | then |
233 | 233 | message_echo "WARNING: ${PORT_DBDIR} is missing. All port options are recognized as default." |
234 | 234 | fi |
235 | - pkgsys_get_saved_port_oprions_timestamps_all > $tmp_ls.db | |
236 | - pkgsys_get_current_port_oprions_timestamp > $tmp_ls.log | |
237 | - pkgsys_get_changed_port_oprions "$tmp_ls.db" "$tmp_ls.log" > $tmp_ls.diff | |
235 | + pkgsys_get_saved_port_options_timestamps_all > $tmp_ls.db | |
236 | + pkgsys_get_current_port_options_timestamp > $tmp_ls.log | |
237 | + pkgsys_get_changed_port_options "$tmp_ls.db" "$tmp_ls.log" > $tmp_ls.diff | |
238 | 238 | if ! [ `wc -l < $tmp_ls.diff` -gt 0 ] |
239 | 239 | then |
240 | 240 | message_echo |
@@ -270,7 +270,7 @@ command_do_reset_changed_portdb () | ||
270 | 270 | fi |
271 | 271 | done |
272 | 272 | message_echo "INFO: Recording for not inspected ports..." |
273 | - pkgsys_conv_portorigin_to_port_oprion_timestamp_logname < $tmp_ls.uninspected.origin > $tmp_ls.uninspected.logname | |
273 | + pkgsys_conv_portorigin_to_port_option_timestamp_logname < $tmp_ls.uninspected.origin > $tmp_ls.uninspected.logname | |
274 | 274 | str_escape_regexp_filter < $tmp_ls.uninspected.dbfile | sed 's/^/^/;s/$/[[:space:]]/' > $tmp_ls.uninspected.dbfile_ptn |
275 | 275 | paste "$tmp_ls.uninspected.dbfile_ptn" "$tmp_ls.uninspected.logname" | while read -r dbfile_ptn logname |
276 | 276 | do |
@@ -210,32 +210,34 @@ command_pkgs_pkgsanity () | ||
210 | 210 | do |
211 | 211 | pkg=`sed -n ${iline}p "$tmp_list.pkgs"` |
212 | 212 | iline=$((${iline}+1)) |
213 | - origin=`pkg_info_flavored_origin "$pkg"` | |
214 | - [ -n "$origin" ] || continue | |
215 | - env LANG=C grep -q -Fx "$origin" "${DBDIR}/damaged_package" 2>/dev/null && continue | |
216 | - pkgsys_sanitychk_pkgcontents "$pkg" is_reinstall_encouraged && continue | |
217 | - port_path=`pkgsys_get_portpath_from_origin "$origin"` | |
218 | - if [ ! -d "$port_path" ] | |
219 | - then | |
220 | - message_echo "WARNING: $pkg ($origin) is obsolete." >&2 | |
221 | - message_echo >&2 | |
222 | - continue | |
223 | - fi | |
224 | - if [ $is_reinstall_encouraged = no ] | |
225 | - then | |
226 | - if [ $opt_batch_mode = no ] | |
213 | + for origin in `pkg_info_flavored_origins "$pkg"` | |
214 | + do | |
215 | + [ -n "$origin" ] || continue | |
216 | + env LANG=C grep -q -Fx "$origin" "${DBDIR}/damaged_package" 2>/dev/null && continue | |
217 | + pkgsys_sanitychk_pkgcontents "$pkg" is_reinstall_encouraged && continue | |
218 | + port_path=`pkgsys_get_portpath_from_origin "$origin"` | |
219 | + if [ ! -d "$port_path" ] | |
227 | 220 | then |
228 | - message_echo "Do you want to reinstall it? (y/[n])" | |
229 | - message_query_yn_default_no || continue | |
221 | + message_echo "WARNING: $pkg ($origin) is obsolete." >&2 | |
222 | + message_echo >&2 | |
223 | + continue | |
230 | 224 | fi |
231 | - else | |
232 | - if [ $opt_batch_mode = no ] | |
225 | + if [ $is_reinstall_encouraged = no ] | |
233 | 226 | then |
234 | - message_echo "Do you want to reinstall it? ([y]/n)" | |
235 | - message_query_yn_default_yes || continue | |
227 | + if [ $opt_batch_mode = no ] | |
228 | + then | |
229 | + message_echo "Do you want to reinstall it? (y/[n])" | |
230 | + message_query_yn_default_no || continue | |
231 | + fi | |
232 | + else | |
233 | + if [ $opt_batch_mode = no ] | |
234 | + then | |
235 | + message_echo "Do you want to reinstall it? ([y]/n)" | |
236 | + message_query_yn_default_yes || continue | |
237 | + fi | |
238 | + database_record_reconf_recover_sanity "$origin" | |
236 | 239 | fi |
237 | - database_record_reconf_recover_sanity "$origin" | |
238 | - fi | |
240 | + done | |
239 | 241 | done |
240 | 242 | } |
241 | 243 |
@@ -632,7 +632,7 @@ database_build_inspect_dependencies () | ||
632 | 632 | else |
633 | 633 | cp /dev/null "$dbpath/ports_options.current" |
634 | 634 | fi |
635 | - pkgsys_save_port_oprion_timestamp "$origin" | |
635 | + pkgsys_save_port_option_timestamp "$origin" | |
636 | 636 | # Get the lists of requirements in the flavored form |
637 | 637 | database_build_create_pkgtag "$origin" |
638 | 638 | for variable in PKG_DEPENDS EXTRACT_DEPENDS PATCH_DEPENDS FETCH_DEPENDS BUILD_DEPENDS LIB_DEPENDS |
@@ -438,20 +438,29 @@ pkgsys_def_pkgtools () | ||
438 | 438 | # Return the total storage space occupied by the installed files in bytes |
439 | 439 | pkg info -qs "$@" 2> /dev/null | sed 's/KiB$/*1024/;s/MiB$/*1024^2/;s/GiB$/*1024^3/;s/B$//' | tr '\n' + | sed 's/+$//' | bc -l |
440 | 440 | } |
441 | - pkg_info_flavor () | |
441 | + pkg_info_flavors () | |
442 | + # For an unflavored pattern, all matching flavors are returned. | |
442 | 443 | { |
443 | 444 | local glob_unflavored |
444 | 445 | glob_unflavored=$1 |
445 | 446 | pkg query -g '%At\t%Av' "$glob_unflavored" 2> /dev/null | env LANG=C grep -E '^flavor[[:space:]]' | cut -f 2 |
446 | 447 | } |
447 | - pkg_info_flavored_origin () | |
448 | + pkg_info_flavored_origins () | |
449 | + # For an unflavored pattern, all matching flavors are returned. | |
448 | 450 | { |
449 | 451 | local glob_unflavored origin_unflavored |
450 | 452 | glob_unflavored=$1 |
451 | 453 | origin_unflavored=`pkg_info_qo "$glob_unflavored" 2> /dev/null || :` |
452 | - flavor=`pkg_info_flavor "$glob_unflavored" 2> /dev/null || :` | |
453 | - [ -z "$flavor" ] || flavor=@$flavor | |
454 | - echo "$origin_unflavored$flavor" | |
454 | + flavors=`pkg_info_flavors "$glob_unflavored" 2> /dev/null || :` | |
455 | + if [ -z "$flavors" ] | |
456 | + then | |
457 | + echo "$origin_unflavored" | |
458 | + else | |
459 | + for flavor in $flavors | |
460 | + do | |
461 | + echo "$origin_unflavored@$flavor" | |
462 | + done | |
463 | + fi | |
455 | 464 | } |
456 | 465 | pkg_info_all_flavored_origins () |
457 | 466 | { |
@@ -866,7 +875,7 @@ pkgsys_def_pkgtools () | ||
866 | 875 | # Return the total storage space occupied by the installed files in bytes |
867 | 876 | pkg_info -qs "$@" 2> /dev/null | sed 's/[^0-9]*/*1024/' | tr '\n' + | sed 's/+$//' | bc -l |
868 | 877 | } |
869 | - pkg_info_flavor () | |
878 | + pkg_info_flavors () | |
870 | 879 | { |
871 | 880 | pkg_info -qe "$@" 2> /dev/null && echo |
872 | 881 | : |
@@ -1105,15 +1114,22 @@ pkgsys_get_installed_pkg_from_origin () | ||
1105 | 1114 | origin=$1 |
1106 | 1115 | origin_unflavored=`pkgsys_get_unflavored_origin "$origin"` |
1107 | 1116 | flavor_origin=`pkgsys_get_flavor_from_origin "$origin"` |
1108 | - pkg_info_qO "$origin_unflavored" 2> /dev/null | while read pkgname | |
1109 | - do | |
1110 | - flavor_pkg=`pkg_info_flavor "$pkgname"` | |
1111 | - if [ "x$flavor_origin" = "x$flavor_pkg" ] | |
1112 | - then | |
1113 | - echo "$pkgname" | |
1114 | - break | |
1115 | - fi | |
1116 | - done | |
1117 | + if [ -n "$flavor_origin" ] | |
1118 | + then | |
1119 | + for pkgname in `pkg_info_qO "$origin_unflavored" 2> /dev/null` | |
1120 | + do | |
1121 | + for flavor_pkg in `pkg_info_flavors "$pkgname"` | |
1122 | + do | |
1123 | + if [ "x$flavor_origin" = "x$flavor_pkg" ] | |
1124 | + then | |
1125 | + echo "$pkgname" | |
1126 | + return | |
1127 | + fi | |
1128 | + done | |
1129 | + done | |
1130 | + else | |
1131 | + pkg_info_qO "$origin_unflavored" 2> /dev/null | |
1132 | + fi | |
1117 | 1133 | : |
1118 | 1134 | } |
1119 | 1135 |
@@ -1141,8 +1157,11 @@ pkgsys_exists_from_orig () | ||
1141 | 1157 | origin_unflavored=`pkgsys_get_unflavored_origin "$origin"` |
1142 | 1158 | pkg_info_eO "$origin_unflavored" 2> /dev/null || return |
1143 | 1159 | flavor_origin=`pkgsys_get_flavor_from_origin "$origin"` |
1144 | - flavor_pkg=`pkg_info_flavor "$origin_unflavored"` | |
1145 | - [ "x$flavor_origin" = "x$flavor_pkg" ] | |
1160 | + for flavor_pkg in `pkg_info_flavors "$origin_unflavored"` | |
1161 | + do | |
1162 | + [ "x$flavor_origin" = "x$flavor_pkg" ] && return | |
1163 | + done | |
1164 | + false | |
1146 | 1165 | } |
1147 | 1166 | |
1148 | 1167 | # ============= Generate the package names vs origins table at the initial state ============= |
@@ -1178,14 +1197,16 @@ pkgsys_get_init_pkg_from_orig () | ||
1178 | 1197 | else |
1179 | 1198 | origin_unflavored=`pkgsys_get_unflavored_origin "$origin"` |
1180 | 1199 | flavor_origin=`pkgsys_get_flavor_from_origin "$origin"` |
1181 | - pkg_info_qO "$origin_unflavored" 2> /dev/null | while read pkgname | |
1200 | + for pkgname in `pkg_info_qO "$origin_unflavored" 2> /dev/null` | |
1182 | 1201 | do |
1183 | - flavor_pkg=`pkg_info_flavor "$pkgname"` | |
1184 | - if [ "x$flavor_origin" = "x$flavor_pkg" ] | |
1185 | - then | |
1186 | - echo "$pkgname" | |
1187 | - break | |
1188 | - fi | |
1202 | + for flavor_pkg in `pkg_info_flavors "$pkgname"` | |
1203 | + do | |
1204 | + if [ "x$flavor_origin" = "x$flavor_pkg" ] | |
1205 | + then | |
1206 | + echo "$pkgname" | |
1207 | + return | |
1208 | + fi | |
1209 | + done | |
1189 | 1210 | done |
1190 | 1211 | fi |
1191 | 1212 | : |
@@ -1671,13 +1692,13 @@ pkgsys_sanitychk_pkgcontents () | ||
1671 | 1692 | } |
1672 | 1693 | |
1673 | 1694 | # ============= Check whether the port options database is once saved ============= |
1674 | -pkgsys_exists_saved_port_oprions_timestamps () | |
1695 | +pkgsys_exists_saved_port_options_timestamps () | |
1675 | 1696 | { |
1676 | 1697 | [ -d "${DBDIR}/ls_dbdir" ] |
1677 | 1698 | } |
1678 | 1699 | |
1679 | 1700 | # ============= Get the current all timestamp information of port options ============= |
1680 | -pkgsys_get_current_port_oprions_timestamp () | |
1701 | +pkgsys_get_current_port_options_timestamp () | |
1681 | 1702 | { |
1682 | 1703 | local portdb_needle_regexp |
1683 | 1704 | portdb_needle_regexp=`str_escape_regexp "$1"` |
@@ -1700,20 +1721,20 @@ pkgsys_get_current_port_oprions_timestamp () | ||
1700 | 1721 | } |
1701 | 1722 | |
1702 | 1723 | # ============= Get the saved all timestamp information of port options ============= |
1703 | -pkgsys_get_saved_port_oprions_timestamps_all () | |
1724 | +pkgsys_get_saved_port_options_timestamps_all () | |
1704 | 1725 | { |
1705 | 1726 | mkdir -p "${DBDIR}/ls_dbdir" |
1706 | 1727 | cat "${DBDIR}/ls_dbdir/"*.log 2> /dev/null || : |
1707 | 1728 | } |
1708 | 1729 | |
1709 | 1730 | # ============= Convert a list of port origins to port options timestamp log names ============= |
1710 | -pkgsys_conv_portorigin_to_port_oprion_timestamp_logname () | |
1731 | +pkgsys_conv_portorigin_to_port_option_timestamp_logname () | |
1711 | 1732 | { |
1712 | 1733 | sed 's|/|_|' |
1713 | 1734 | } |
1714 | 1735 | |
1715 | 1736 | # ============= Get the file name of the port options database of a port ============= |
1716 | -pkgsys_get_port_oprion_database () | |
1737 | +pkgsys_get_port_option_database () | |
1717 | 1738 | { |
1718 | 1739 | local origin |
1719 | 1740 | origin=$1 |
@@ -1726,23 +1747,23 @@ pkgsys_get_port_oprion_database () | ||
1726 | 1747 | } |
1727 | 1748 | |
1728 | 1749 | # ============= Save the timestamp information of port options of a port ============= |
1729 | -pkgsys_save_port_oprion_timestamp () | |
1750 | +pkgsys_save_port_option_timestamp () | |
1730 | 1751 | { |
1731 | 1752 | local origin portoptlog portoptdb |
1732 | 1753 | origin=$1 |
1733 | - portoptlog=`echo "$origin" | pkgsys_conv_portorigin_to_port_oprion_timestamp_logname` | |
1734 | - portoptdb=`pkgsys_get_port_oprion_database "$origin"` | |
1754 | + portoptlog=`echo "$origin" | pkgsys_conv_portorigin_to_port_option_timestamp_logname` | |
1755 | + portoptdb=`pkgsys_get_port_option_database "$origin"` | |
1735 | 1756 | mkdir -p "${DBDIR}/ls_dbdir" |
1736 | - pkgsys_get_current_port_oprions_timestamp "$portoptdb" > ${DBDIR}/ls_dbdir/$portoptlog.log 2> /dev/null || : | |
1757 | + pkgsys_get_current_port_options_timestamp "$portoptdb" > ${DBDIR}/ls_dbdir/$portoptlog.log 2> /dev/null || : | |
1737 | 1758 | } |
1738 | 1759 | |
1739 | 1760 | # ============= Get changed port options from the saved point ============= |
1740 | -pkgsys_get_changed_port_oprions () | |
1761 | +pkgsys_get_changed_port_options () | |
1741 | 1762 | { |
1742 | 1763 | local saved_log current_log tmp_log |
1743 | 1764 | saved_log=$1 |
1744 | 1765 | current_log=$2 |
1745 | - tmp_log=${TMPDIR}/pkgsys_get_changed_port_oprions.log | |
1766 | + tmp_log=${TMPDIR}/pkgsys_get_changed_port_options.log | |
1746 | 1767 | { |
1747 | 1768 | env LANG=C grep -vxF -f "$current_log" "$saved_log" || : |
1748 | 1769 | env LANG=C grep -vxF -f "$saved_log" "$current_log" || : |
@@ -249,41 +249,43 @@ reinstall_backup_and_delete_conflicts () | ||
249 | 249 | message_echo "INFO: Deinstalling conflicting packages for $REINSTALL_ORIGPKGTAG." |
250 | 250 | while read pkg |
251 | 251 | do |
252 | - origin=`pkg_info_flavored_origin "$pkg"` | |
253 | - origin_equiv=`database_query_get_equivalent_orgin "$origin"` | |
254 | - message_echo "INFO: Backing up and deleting a conflict, $origin ($pkg)." | |
255 | - origin_regexp_esc=`str_escape_regexp "$origin"` | |
256 | - origin_equiv_regexp_esc=`str_escape_regexp "$origin_equiv"` | |
257 | - if [ -d "${DBDIR}/requires/$origin" ] | |
258 | - then | |
259 | - backup_pkgdir=${DBDIR}/backup_packages | |
260 | - else | |
261 | - backup_pkgdir=${PKGREPOSITORY} | |
262 | - fi | |
263 | - mkdir -p "$backup_pkgdir" | |
264 | - if backup_pkg=`pkgsys_get_backup_pkg "$origin"` || backup_pkg=`pkgsys_get_backup_pkg "$origin_equiv"` | |
265 | - then | |
266 | - message_echo "INFO: backup package already exists as $backup_pkg" | |
267 | - elif ! backup_pkg=`pkgsys_create_backup_pkg "$pkg" "$backup_pkgdir"` | |
268 | - then | |
269 | - message_echo "WARNING: Failed to create the backup package, the conflict is kept installed." >&2 | |
270 | - continue | |
271 | - fi | |
272 | - env LANG=C grep -v -E "^${origin_regexp_esc}[[:space:]]" "${DBDIR}/deleted_conflicts" \ | |
273 | - > ${DBDIR}/deleted_conflicts.tmp 2> /dev/null || : | |
274 | - if [ -n "$origin_equiv_regexp_esc" ] | |
275 | - then | |
276 | - env LANG=C grep -v -E "^${origin_equiv_regexp_esc}[[:space:]]" "${DBDIR}/deleted_conflicts.tmp" \ | |
277 | - > ${DBDIR}/deleted_conflicts.tmp2 2> /dev/null || : | |
278 | - mv "${DBDIR}/deleted_conflicts.tmp2" "${DBDIR}/deleted_conflicts.tmp" | |
279 | - fi | |
280 | - printf '%s\t%s\n' "$origin" "$pkg" >> ${DBDIR}/deleted_conflicts.tmp | |
281 | - [ -n "$origin_equiv" ] && printf '%s\t%s\n' "$origin_equiv" "$pkg" >> ${DBDIR}/deleted_conflicts.tmp | |
282 | - mv "${DBDIR}/deleted_conflicts.tmp" "${DBDIR}/deleted_conflicts" | |
283 | - pkg_delete_f "$pkg" || \ | |
284 | - { | |
285 | - message_echo "WARNING: Failed to deinstall $pkg by $PKGSYS_CMD_PKG_DELETE." >&2 | |
286 | - } | |
252 | + for origin in `pkg_info_flavored_origins "$pkg"` | |
253 | + do | |
254 | + origin_equiv=`database_query_get_equivalent_orgin "$origin"` | |
255 | + message_echo "INFO: Backing up and deleting a conflict, $origin ($pkg)." | |
256 | + origin_regexp_esc=`str_escape_regexp "$origin"` | |
257 | + origin_equiv_regexp_esc=`str_escape_regexp "$origin_equiv"` | |
258 | + if [ -d "${DBDIR}/requires/$origin" ] | |
259 | + then | |
260 | + backup_pkgdir=${DBDIR}/backup_packages | |
261 | + else | |
262 | + backup_pkgdir=${PKGREPOSITORY} | |
263 | + fi | |
264 | + mkdir -p "$backup_pkgdir" | |
265 | + if backup_pkg=`pkgsys_get_backup_pkg "$origin"` || backup_pkg=`pkgsys_get_backup_pkg "$origin_equiv"` | |
266 | + then | |
267 | + message_echo "INFO: backup package already exists as $backup_pkg" | |
268 | + elif ! backup_pkg=`pkgsys_create_backup_pkg "$pkg" "$backup_pkgdir"` | |
269 | + then | |
270 | + message_echo "WARNING: Failed to create the backup package, the conflict is kept installed." >&2 | |
271 | + continue | |
272 | + fi | |
273 | + env LANG=C grep -v -E "^${origin_regexp_esc}[[:space:]]" "${DBDIR}/deleted_conflicts" \ | |
274 | + > ${DBDIR}/deleted_conflicts.tmp 2> /dev/null || : | |
275 | + if [ -n "$origin_equiv_regexp_esc" ] | |
276 | + then | |
277 | + env LANG=C grep -v -E "^${origin_equiv_regexp_esc}[[:space:]]" "${DBDIR}/deleted_conflicts.tmp" \ | |
278 | + > ${DBDIR}/deleted_conflicts.tmp2 2> /dev/null || : | |
279 | + mv "${DBDIR}/deleted_conflicts.tmp2" "${DBDIR}/deleted_conflicts.tmp" | |
280 | + fi | |
281 | + printf '%s\t%s\n' "$origin" "$pkg" >> ${DBDIR}/deleted_conflicts.tmp | |
282 | + [ -n "$origin_equiv" ] && printf '%s\t%s\n' "$origin_equiv" "$pkg" >> ${DBDIR}/deleted_conflicts.tmp | |
283 | + mv "${DBDIR}/deleted_conflicts.tmp" "${DBDIR}/deleted_conflicts" | |
284 | + pkg_delete_f "$pkg" || \ | |
285 | + { | |
286 | + message_echo "WARNING: Failed to deinstall $pkg by $PKGSYS_CMD_PKG_DELETE." >&2 | |
287 | + } | |
288 | + done | |
287 | 289 | done |
288 | 290 | cat "${DBDIR}/deleted_conflicts" 2> /dev/null | sort -u > ${DBDIR}/deleted_conflicts.tmp |
289 | 291 | mv "${DBDIR}/deleted_conflicts.tmp" "${DBDIR}/deleted_conflicts" |
@@ -325,12 +327,14 @@ reinstall_backup_and_delete_remaining_install_conflicts () | ||
325 | 327 | pkg=`pkg_which "$filepath" || :` |
326 | 328 | [ -z "$pkg" ] && continue |
327 | 329 | env LANG=C grep -qFx "$pkg" "$tmp_conflicts.pkgs" && continue |
328 | - origin=`pkg_info_flavored_origin "$pkg"` | |
329 | - [ x"$origin" = x"$REINSTALL_ORIGIN" ] && continue | |
330 | - [ x"$origin" = x"$REINSTALL_ORIGIN_equiv" ] && continue | |
331 | - origin_equiv=`database_query_get_equivalent_orgin "$origin"` | |
332 | - [ x"$origin_equiv" = x"$REINSTALL_ORIGIN" ] && continue | |
333 | - printf '%s\t%s\n' "$pkg" "$filepath" >> $db_conflict.tmp | |
330 | + for origin in `pkg_info_flavored_origins "$pkg"` | |
331 | + do | |
332 | + [ x"$origin" = x"$REINSTALL_ORIGIN" ] && continue | |
333 | + [ x"$origin" = x"$REINSTALL_ORIGIN_equiv" ] && continue | |
334 | + origin_equiv=`database_query_get_equivalent_orgin "$origin"` | |
335 | + [ x"$origin_equiv" = x"$REINSTALL_ORIGIN" ] && continue | |
336 | + printf '%s\t%s\n' "$pkg" "$filepath" >> $db_conflict.tmp | |
337 | + done | |
334 | 338 | done |
335 | 339 | if [ -e "$db_conflict.tmp" ] |
336 | 340 | then |
@@ -620,9 +624,11 @@ reinstall_pkg_backup () | ||
620 | 624 | } |
621 | 625 | |
622 | 626 | # ============= Deinstallation of the currently installed package ============= |
627 | +# For a flavored package, its unflavored one is also deinstalled if existing. | |
628 | +# For an unflavored package, its all flavored ones are also deinstalled if existing. | |
623 | 629 | reinstall_deinstall () |
624 | 630 | { |
625 | - local tmp_installedpkg REINSTALL_ORIGIN_equiv installed_pkgs dev_out dev_err | |
631 | + local tmp_installedpkg REINSTALL_ORIGIN_equiv installed_pkgs dev_out dev_err flavor | |
626 | 632 | dev_out=/dev/stdout |
627 | 633 | dev_err=/dev/stderr |
628 | 634 | if [ $opt_batch_mode = yes ] |
@@ -643,6 +649,12 @@ reinstall_deinstall () | ||
643 | 649 | message_echo "WARNING: Failed to deinstall." >&2 |
644 | 650 | } |
645 | 651 | else |
652 | + flavor=`pkgsys_get_flavor_from_origin "$REINSTALL_ORIGIN"` | |
653 | + if [ -n "$flavor" ] | |
654 | + then | |
655 | + pkgsys_get_unflavored_origin "$REINSTALL_ORIGIN" >> $tmp_installedpkg | |
656 | + else | |
657 | + fi | |
646 | 658 | while read pkg |
647 | 659 | do |
648 | 660 | message_echo "INFO: Deinstalling $pkg by $PKGSYS_CMD_PKG_DELETE." >&2 |