OSDN Git Service

Fixed a bug in portsreinstall-upgrade that unchanged packages were deleted.
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Thu, 20 Sep 2018 01:56:20 +0000 (10:56 +0900)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Thu, 20 Sep 2018 01:56:20 +0000 (10:56 +0900)
 Changes to be committed:
modified:   HISTORY
modified:   lib/libmain.sh
modified:   lib/upgrade/libcommand_do.sh

HISTORY
lib/libmain.sh
lib/upgrade/libcommand_do.sh

diff --git a/HISTORY b/HISTORY
index f1ba3d5..1a23671 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -33,6 +33,7 @@
 [BUG FIX] Flavored requirements were incorrectly inspected. This also caused disability of the use of default packages for flavord ports with the default configuration. 
 [BUG FIX] The message about the evaluated dependency level in show command was wrong. 
 [BUG FIX] Unselected leaf ports were skipped in (re)installtion.
+[BUG FIX] Some upgrading operations by portsreinstall-upgrade(8) were imperfect.
 
 4.0.0 (29 June 2018)
 [NEW] Flavor is supported. Related to this feature, representations of port origins without flavor is recognized to exactly match the unflavored ones.
index 4bbde80..26fdbd7 100644 (file)
@@ -12,7 +12,7 @@ main_set_version ()
        MYVERSION=4.1.0
        COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$'
        # Template for development versions
-       MYVERSION=4.0.0+toward_4.1.0_20180920012630
+       MYVERSION=4.0.0+toward_4.1.0_20180920105217
        COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
 }
 
index 8814429..29fccd6 100644 (file)
@@ -67,18 +67,22 @@ command_do_reinst_ports ()
                target=`echo "$1" | cut -f 2`
                argument=`echo "$1" | cut -f 3`
                additional=`echo "$1" | cut -f 4`
-               target_regexp=`str_escape_regexp "$target"`
-               timestamp_init=`grep -E "^${target_regexp}[[:space:]]" "${DBDIR}/initial_pkgs_snapshot.csv" | cut -f 2`
-               timestamp_fin=`grep -E "^${target_regexp}[[:space:]]" "${ETCDIR}/final_pkgs_snapshot.csv" | cut -f 2`
-               if [ -n "$timestamp_init" -a -n "$timestamp_fin" ]
+               target_pkg=`pkgsys_get_installed_pkg_from_origin "$target"`
+               if [ -n "$target_pkg" ]
                then
-                       pkgtype_init=`expr "$timestamp_init" : '\([^:]*\):' || :`
-                       pkgtype_fin=`expr "$timestamp_fin" : '\([^:]*\):' || :`
-                       if [ -n "$pkgtype_init" -a -n "$pkgtype_fin" -a "x$pkgtype_init" = "x$pkgtype_fin" ]
+                       target_regexp=`str_escape_regexp "$target_pkg"`
+                       timestamp_init=`grep -E "^${target_regexp}[[:space:]]" "${DBDIR}/initial_pkgs_snapshot.csv" | cut -f 2`
+                       timestamp_fin=`grep -E "^${target_regexp}[[:space:]]" "${ETCDIR}/final_pkgs_snapshot.csv" | cut -f 2`
+                       if [ -n "$timestamp_init" -a -n "$timestamp_fin" ]
                        then
-                               datetime_init=`expr "$timestamp_init" : '[^:]*:\([0-9]*\)' || :`
-                               datetime_fin=`expr "$timestamp_fin" : '[^:]*:\([0-9]*\)' || :`
-                               [ -n "$datetime_init" -a -n "$datetime_fin" -a "$datetime_init" -ge "$datetime_fin" ] && return
+                               pkgtype_init=`expr "$timestamp_init" : '\([^:]*\):' || :`
+                               pkgtype_fin=`expr "$timestamp_fin" : '\([^:]*\):' || :`
+                               if [ -n "$pkgtype_init" -a -n "$pkgtype_fin" -a "x$pkgtype_init" = "x$pkgtype_fin" ]
+                               then
+                                       datetime_init=`expr "$timestamp_init" : '[^:]*:\([0-9]*\)' || :`
+                                       datetime_fin=`expr "$timestamp_fin" : '[^:]*:\([0-9]*\)' || :`
+                                       [ -n "$datetime_init" -a -n "$datetime_fin" -a "$datetime_init" -ge "$datetime_fin" ] && return
+                               fi
                        fi
                fi
                case $cmd in