• R/O
  • HTTP
  • SSH
  • HTTPS

current: Commit

This is for active development.
New funtionalities are to be added actively.


Commit MetaInfo

Revisiona8a6a1334abcdd963ab32e851d14551b9646effa (tree)
Time2022-05-19 02:37:00
AuthorMamoru Sakaue <sakaue.mamoru@mwgh...>
CommiterMamoru Sakaue

Log Message

[BUG FIX] Packages for which the flavor mechanism is newly introduced sometimes had their old packages remain as conflict.

Changes to be committed:

modified: HISTORY
modified: README
modified: lib/libdatabase_build.sh
modified: lib/libdatabase_query.sh
modified: lib/libmain.sh
modified: lib/libreinstall.sh

Change Summary

Incremental Difference

--- a/HISTORY
+++ b/HISTORY
@@ -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.
13 4.1.1 (20 April 2022)
24 [IMPROVED] Adapt to the specification change of pkg-create(8) that the default extension of the package files become "pkg".
35 [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.
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
11 ================================================================================
22 portsreinstall - ports upgrading utility for massive forced reinstallation
3- Version 4.1.1, April 20, 2022
3+ Version 4.1.2, May ??, 2022
44 Copyright (C) 2010-2022 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
55 ================================================================================
66
--- a/lib/libdatabase_build.sh
+++ b/lib/libdatabase_build.sh
@@ -195,7 +195,7 @@ database_build_setup_initial_node ()
195195 # ============= Set up a temporary database node for the replaced/moved information of a port =============
196196 database_build_setup_replace_node ()
197197 {
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
199199 origin_orig=$1
200200 portoption_before=$2
201201 portoption_after=$3
@@ -261,6 +261,31 @@ database_build_setup_replace_node ()
261261 else
262262 origin=
263263 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
264289 [ "x$origin_orig" = "x$origin" ] || echo "$origin" > $dbpath/origin
265290 cat "$tmp_msg" 2> /dev/null || :
266291 touch "$dbpath/complete_as_node"
--- a/lib/libdatabase_query.sh
+++ b/lib/libdatabase_query.sh
@@ -58,15 +58,27 @@ database_query_show_list_failure ()
5858 :
5959 }
6060
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+
6170 # ============= Show a list of failed restoration of conflict =============
6271 database_query_show_list_failed_conflicts_restoration ()
6372 {
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
6577 then
6678 message_echo "INFO: No item is registered in this list."
6779 return 1
6880 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" \
7082 | while read origin pkg
7183 do
7284 pkg_regexp=`str_escape_regexp "$pkg"`
@@ -833,8 +845,8 @@ database_query_exists_in_list ()
833845 list=`ls "${DBDIR}"/fossil_pkgs/fossil_since_* | head -n 1`
834846 ;;
835847 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:]]" || :
838850 return
839851 ;;
840852 taboo )
--- a/lib/libmain.sh
+++ b/lib/libmain.sh
@@ -9,11 +9,11 @@
99 # ============= Define the software version =============
1010 main_set_version ()
1111 {
12- MYVERSION=4.1.1
12+ MYVERSION=4.1.2
1313 COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$'
1414 # 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]+))$'
1717 }
1818
1919 # ============= Parse options, arguments and control parameters =============
--- a/lib/libreinstall.sh
+++ b/lib/libreinstall.sh
@@ -487,7 +487,7 @@ reinstall_restore_conflicts ()
487487 > ${DBDIR}/deleted_conflicts.tmp || :
488488 mv "${DBDIR}/deleted_conflicts.tmp" "${DBDIR}/deleted_conflicts"
489489 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
491491 fi
492492 done < $tmpsrc
493493 }
Show on old repository browser