OSDN Git Service

Fixed a bug that deleting packages didn't work in portsreinstall-upgrade.
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 12 Sep 2018 16:18:45 +0000 (00:18 +0800)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 12 Sep 2018 16:18:45 +0000 (00:18 +0800)
 Changes to be committed:
modified:   lib/libcommand_pkgs.sh
modified:   lib/libmain.sh
modified:   lib/upgrade/libcommand_do.sh

lib/libcommand_pkgs.sh
lib/libmain.sh
lib/upgrade/libcommand_do.sh

index c78201c..75fde3a 100644 (file)
@@ -294,7 +294,7 @@ command_pkgs_packupgrade_create__manifest_delete ()
        {
                local origin
                origin=$1
-               printf '%s\t%s\t%s\n' delete - "$origin" >> ${DBDIR}/command_packupgrade/etc/manifest.lst.delete
+               printf '%s\t%s\t%s\n' delete "$origin" NA >> ${DBDIR}/command_packupgrade/etc/manifest.lst.delete
        }
        _program_exec_and_record_completion__operation ()
        {
@@ -356,15 +356,15 @@ command_pkgs_packupgrade_create__manifest_reinst ()
                        then
                                while read origin_old
                                do
-                                       printf '%s\t%s\t%s\n' delete - "$origin_old" 
+                                       printf '%s\t%s\t%s\n' delete "$origin_old" NA
                                done < ${DBDIR}/moved_from/$origin/initial_orig >> $tmp_manifest
                        fi
-                       printf '%s\t%s\t%s\n' delete - "$origin" >> $tmp_manifest
+                       printf '%s\t%s\t%s\n' delete "$origin" NA >> $tmp_manifest
                        pkgsys_get_conflicting_pkgs_patterns install "$origin" | while read pkg_pattern
                        do
-                               printf '%s\t%s\t%s\n' delete_pattern - "$pkg_pattern" >> $tmp_manifest
+                               printf '%s\t%s\t%s\n' delete_pattern "$pkg_pattern" NA >> $tmp_manifest
                        done
-                       printf '%s\t%s\t%s\n' add "$pkgname" null >> $tmp_manifest
+                       printf '%s\t%s\t%s\n' add "$pkgname" NA >> $tmp_manifest
                fi
                cat "$tmp_manifest" >> $dstdir/etc/manifest.lst.update
        }
index 8d113ef..ab43b0c 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_20180912224956
+       MYVERSION=4.0.0+toward_4.1.0_20180913001823
        COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
 }
 
index fa7ee9c..41ba502 100644 (file)
@@ -41,10 +41,10 @@ command_do_chk_pkg_paths ()
                                        additional=$pkgpath
                                        ;;
                                delete | delete_pattern )
-                                       argument=-
+                                       argument=NA
                                        ;;
                                *)
-                                       message_echo "ERROR: Invalid command [$cmd $target $argument" >&2
+                                       message_echo "ERROR: Invalid command [$cmd] [$target] [$argument]" >&2
                                        exit 1
                        esac
                        printf '%s\t%s\t%s\t%s\n' "$cmd" "$target" "$argument" "$additional"
@@ -62,7 +62,7 @@ command_do_reinst_ports ()
        PROGRAM_DEPENDS='CHK_PKGS'
        _program_exec_restartable_loop_operation__routine ()
        {
-               local cmd target argument additional target_regexp timestamp_init timestamp_fin pkgtype_init pkgtype_fin target_pkg pkgpath item conflict pkgs_pkgtools
+               local cmd target argument additional target_regexp timestamp_init timestamp_fin pkgtype_init pkgtype_fin datetime_init datetime_fin origin target_pkg pkg pkg_pattern pkgpath item conflict pkgs_pkgtools
                cmd=`echo "$1" | cut -f 1`
                target=`echo "$1" | cut -f 2`
                argument=`echo "$1" | cut -f 3`
@@ -83,7 +83,7 @@ command_do_reinst_ports ()
                fi
                case $cmd in
                        delete )
-                               origin=$argument
+                               origin=$target
                                if pkgsys_exists_from_orig "$origin"
                                then
                                        target_pkg=`pkgsys_get_installed_pkg_from_origin "$origin"`
@@ -98,7 +98,7 @@ command_do_reinst_ports ()
                                fi
                                ;;
                        delete_pattern )
-                               pkg_pattern=$argument
+                               pkg_pattern=$target
                                pkgsys_get_installed_pkg_from_glob "$pkg_pattern" | while read pkgname
                                do
                                        if [ $opt_dry_run = yes ]
@@ -112,9 +112,10 @@ command_do_reinst_ports ()
                                done
                                ;;
                        add )
-                               if ! pkg_info_e "$target"
+                               pkg=$target
+                               pkgpath=$additional
+                               if ! pkg_info_e "$pkg"
                                then
-                                       pkgpath=$additional
                                        if [ $opt_dry_run = yes ]
                                        then
                                                message_echo "Dry run: Add $pkgpath"
@@ -122,7 +123,7 @@ command_do_reinst_ports ()
                                                if ! pkg_add_fF "$pkgpath"
                                                then
                                                        message_echo "(Continue anyway)" >&2
-                                                       item=`printf '%s\t%s' "$target" "$pkgpath"`
+                                                       item=`printf '%s\t%s' "$pkg" "$pkgpath"`
                                                        fileedit_add_a_line_if_new "$item" "${DBDIR}/stage.loop_list/failed_add"
                                                fi
                                        fi