This is for active development.
New funtionalities are to be added actively.
Revision | a8a6a1334abcdd963ab32e851d14551b9646effa (tree) |
---|---|
Time | 2022-05-19 02:37:00 |
Author | ![]() |
Commiter | Mamoru Sakaue |
[BUG FIX] Packages for which the flavor mechanism is newly introduced sometimes had their old packages remain as conflict.
modified: HISTORY
modified: README
modified: lib/libdatabase_build.sh
modified: lib/libdatabase_query.sh
modified: lib/libmain.sh
modified: lib/libreinstall.sh
@@ -1,3 +1,5 @@ | ||
1 | +4.1.2 (?? May 2022) | |
2 | +[BUG FIX] Packages for which the flavor mechanism is newly introduced sometimes had their old packages remain as conflict. | |
1 | 3 | 4.1.1 (20 April 2022) |
2 | 4 | [IMPROVED] Adapt to the specification change of pkg-create(8) that the default extension of the package files become "pkg". |
3 | 5 | [IMPROVED] Adapt to the behavior change grep(1) as of 12.0-RELEASE that the case distinction is ineffective in some locale, which as a result prevented the execution by users in such locales. |
@@ -1,6 +1,6 @@ | ||
1 | 1 | ================================================================================ |
2 | 2 | portsreinstall - ports upgrading utility for massive forced reinstallation |
3 | - Version 4.1.1, April 20, 2022 | |
3 | + Version 4.1.2, May ??, 2022 | |
4 | 4 | Copyright (C) 2010-2022 Mamoru Sakaue, MwGhennndo, All Rights Reserved. |
5 | 5 | ================================================================================ |
6 | 6 |
@@ -195,7 +195,7 @@ database_build_setup_initial_node () | ||
195 | 195 | # ============= Set up a temporary database node for the replaced/moved information of a port ============= |
196 | 196 | database_build_setup_replace_node () |
197 | 197 | { |
198 | - local origin_orig portoption_before portoption_after origin_trial origin dbpath tmp_msg | |
198 | + local origin_orig portoption_before portoption_after origin_trial origin dbpath tmp_msg flavor_orig flavors flavor origin_trial_unflavored origin_unflavored | |
199 | 199 | origin_orig=$1 |
200 | 200 | portoption_before=$2 |
201 | 201 | portoption_after=$3 |
@@ -261,6 +261,31 @@ database_build_setup_replace_node () | ||
261 | 261 | else |
262 | 262 | origin= |
263 | 263 | fi |
264 | + cat "$tmp_msg" 2> /dev/null || : | |
265 | + # If the flavor mechanism is introduced to an initial origin without flavor, apply the default one. | |
266 | + if [ -n "$origin" -a -n "$origin_trial" ] | |
267 | + then | |
268 | + origin_trial_unflavored=`pkgsys_get_unflavored_origin "$origin_trial"` | |
269 | + origin_unflavored=`pkgsys_get_unflavored_origin "$origin"` | |
270 | + flavor_orig=`pkgsys_get_flavor_from_origin "$origin_trial"` | |
271 | + if [ -z "$flavor_orig" -a "$origin_trial_unflavored" = "$origin_unflavored" ] | |
272 | + then | |
273 | + flavors=`database_build_make "$origin" -V FLAVORS` | |
274 | + if [ -n "$flavors" ] | |
275 | + then | |
276 | + flavor=`expr "$flavors" : '\([^ ]*\).*'` || : | |
277 | + if [ -n "$flavor" ] | |
278 | + then | |
279 | + database_build_register_obsolete_port "$origin_trial" | |
280 | + fileedit_add_a_line_if_new "$origin_trial" "${DBDIR}/moved_ports" | |
281 | + fileedit_rm_a_line "$origin_trial" "${DBDIR}/obsolete_ports" | |
282 | + origin=`pkgsys_compose_flavored_origin "$origin_trial" "$flavor"` | |
283 | + message_echo "${DEPTH_INDEX} ===> Moved to $origin by renaming with the default flavor" | |
284 | + fi | |
285 | + fi | |
286 | + fi > $tmp_msg | |
287 | + cat "$tmp_msg" >> $dbpath/message | |
288 | + fi | |
264 | 289 | [ "x$origin_orig" = "x$origin" ] || echo "$origin" > $dbpath/origin |
265 | 290 | cat "$tmp_msg" 2> /dev/null || : |
266 | 291 | touch "$dbpath/complete_as_node" |
@@ -58,15 +58,27 @@ database_query_show_list_failure () | ||
58 | 58 | : |
59 | 59 | } |
60 | 60 | |
61 | +# ============= Get a list of failed restoration of required conflict ============= | |
62 | +database_query_get_required_deleted_conflicts () | |
63 | +{ | |
64 | + local tmp_filter | |
65 | + tmp_filter=${TMPDIR}/database_query_get_required_deleted_conflicts:filter | |
66 | + str_escape_regexp_filter < ${DBDIR}/moved_ports | sed 's/^/^/;s/$/[[:space:]].*/' > $tmp_filter | |
67 | + env LANG=C grep -v -f "$tmp_filter" "${DBDIR}/deleted_conflicts" 2> /dev/null | |
68 | +} | |
69 | + | |
61 | 70 | # ============= Show a list of failed restoration of conflict ============= |
62 | 71 | database_query_show_list_failed_conflicts_restoration () |
63 | 72 | { |
64 | - if [ `cat "${DBDIR}/deleted_conflicts" 2> /dev/null | wc -l` -eq 0 ] | |
73 | + local tmp_deleted_conflicts | |
74 | + tmp_deleted_conflicts=${TMPDIR}/database_query_show_list_failed_conflicts_restoration:deleted_conflicts | |
75 | + | |
76 | + if ! database_query_get_required_deleted_conflicts > $tmp_deleted_conflicts | |
65 | 77 | then |
66 | 78 | message_echo "INFO: No item is registered in this list." |
67 | 79 | return 1 |
68 | 80 | fi |
69 | - env LANG=C grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern_col1" "${DBDIR}/deleted_conflicts" \ | |
81 | + env LANG=C grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern_col1" "$tmp_deleted_conflicts" \ | |
70 | 82 | | while read origin pkg |
71 | 83 | do |
72 | 84 | pkg_regexp=`str_escape_regexp "$pkg"` |
@@ -833,8 +845,8 @@ database_query_exists_in_list () | ||
833 | 845 | list=`ls "${DBDIR}"/fossil_pkgs/fossil_since_* | head -n 1` |
834 | 846 | ;; |
835 | 847 | conflict ) |
836 | - env LANG=C grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern_col1" "${DBDIR}/deleted_conflicts" 2> /dev/null \ | |
837 | - | env LANG=C grep -q -E "^${origin_esc}[[:space:]]" | |
848 | + database_query_get_required_deleted_conflicts | env LANG=C grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern_col1" 2> /dev/null \ | |
849 | + | env LANG=C grep -q -E "^${origin_esc}[[:space:]]" || : | |
838 | 850 | return |
839 | 851 | ;; |
840 | 852 | taboo ) |
@@ -9,11 +9,11 @@ | ||
9 | 9 | # ============= Define the software version ============= |
10 | 10 | main_set_version () |
11 | 11 | { |
12 | - MYVERSION=4.1.1 | |
12 | + MYVERSION=4.1.2 | |
13 | 13 | COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$' |
14 | 14 | # Template for development versions |
15 | -# MYVERSION=4.1.0+toward_4.1.1_20220418123142 | |
16 | -# COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0-1]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$' | |
15 | + MYVERSION=4.1.1+toward_4.1.2_20220508155922 | |
16 | + COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0-1]\.[0-1]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$' | |
17 | 17 | } |
18 | 18 | |
19 | 19 | # ============= Parse options, arguments and control parameters ============= |
@@ -487,7 +487,7 @@ reinstall_restore_conflicts () | ||
487 | 487 | > ${DBDIR}/deleted_conflicts.tmp || : |
488 | 488 | mv "${DBDIR}/deleted_conflicts.tmp" "${DBDIR}/deleted_conflicts" |
489 | 489 | else |
490 | - message_echo "WARNING: Failed to restore. Note that your system may experience troubles by this error." >&2 | |
490 | + message_echo "WARNING: Failed to restore. Note that your system may undergo troubles by this error." >&2 | |
491 | 491 | fi |
492 | 492 | done < $tmpsrc |
493 | 493 | } |