From c7b2b4a1a6b388e998dfc0503c3a6732b3db2eb9 Mon Sep 17 00:00:00 2001 From: Mamoru Sakaue / MwGhennndo Date: Mon, 27 Aug 2018 00:53:03 +0800 Subject: [PATCH] Bug fix in parsing arguments. Changes to be committed: modified: bin/portsreinstall modified: bin/portsreinstall-chroot modified: lib/chroot-mount/libcommand.sh modified: lib/chroot/libcommand.sh modified: lib/libmain.sh modified: lib/main/libcommand.sh modified: share/bin/portsreinstall-chroot-mount modified: share/bin/portsreinstall-upgrade --- bin/portsreinstall | 2 +- bin/portsreinstall-chroot | 2 +- lib/chroot-mount/libcommand.sh | 2 +- lib/chroot/libcommand.sh | 1 - lib/libmain.sh | 3 +-- lib/main/libcommand.sh | 5 +---- share/bin/portsreinstall-chroot-mount | 2 +- share/bin/portsreinstall-upgrade | 2 +- 8 files changed, 7 insertions(+), 12 deletions(-) diff --git a/bin/portsreinstall b/bin/portsreinstall index af657f4..d676df9 100755 --- a/bin/portsreinstall +++ b/bin/portsreinstall @@ -64,7 +64,7 @@ database_maintain_reset_execflag # ================================================== main_parse_options_arguments "$@" -shift "${OPTIONS_SHIFT}" +shift "${COMMAND_SHIFT}" # ======================================================== # ================== SET UP OF PARAMETERS ================== diff --git a/bin/portsreinstall-chroot b/bin/portsreinstall-chroot index f4facbf..72b47d7 100755 --- a/bin/portsreinstall-chroot +++ b/bin/portsreinstall-chroot @@ -69,7 +69,7 @@ fs_save_current_systembase '' # ================================================== main_parse_options_arguments "$@" -shift "${OPTIONS_SHIFT}" +shift "${COMMAND_SHIFT}" fs_safeguard_basedir "$opt_basedir" diff --git a/lib/chroot-mount/libcommand.sh b/lib/chroot-mount/libcommand.sh index e41d7be..edc3b94 100644 --- a/lib/chroot-mount/libcommand.sh +++ b/lib/chroot-mount/libcommand.sh @@ -22,12 +22,12 @@ command_all_parse_args () exit 1 ;; esac + COMMAND_SHIFT=$(($num_args_init - $#)) } # ============= Execute command operations which do not need package tools ============= command_all_exec_without_pkgtools () { - shift || : case $COMMAND_MODE in mount ) fs_mount diff --git a/lib/chroot/libcommand.sh b/lib/chroot/libcommand.sh index 3bbc2ba..46316bb 100644 --- a/lib/chroot/libcommand.sh +++ b/lib/chroot/libcommand.sh @@ -163,7 +163,6 @@ command_all_exec_main () { case $COMMAND_MODE in do | auto ) - shift || : command_do_pre command_do_starter_portsnap command_do_starter_pkg diff --git a/lib/libmain.sh b/lib/libmain.sh index dd35ad5..581a3e6 100644 --- a/lib/libmain.sh +++ b/lib/libmain.sh @@ -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_20180826163929 + MYVERSION=4.0.0+toward_4.1.0_20180827005243 COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$' } @@ -79,7 +79,6 @@ main_parse_options_arguments () # ============= Argument check for conventional runs ============= command_all_parse_args "$@" - shift "${COMMAND_SHIFT}" } # ============= Define the common termination messages ============= diff --git a/lib/main/libcommand.sh b/lib/main/libcommand.sh index f6c210d..dac453f 100644 --- a/lib/main/libcommand.sh +++ b/lib/main/libcommand.sh @@ -302,7 +302,6 @@ command_exec_without_pkgtools__notify_reset_options () # ============= Execute command operations which do not need package tools ============= command_all_exec_without_pkgtools () { - shift || : case $COMMAND_MODE in clean | load ) command_exec_without_pkgtools__notify_reset_options @@ -326,7 +325,6 @@ command_all_exec_without_pkgtools () command_all_exec_irrespective_of_saved_options () { local arcfile origins_match pkgs_match - shift || : case $COMMAND_MODE in ok ) _command_exec_irrespective_of_saved_options__notify_ignored_options @@ -464,7 +462,6 @@ command_all_exec_irrespective_of_saved_options () command_all_exec_before_tools_upgrade () { local glob origins errno - shift || : case $COMMAND_MODE in reset ) message_echo "Starting to reset the temporary database by preserving the initial snapshot of installed packages..." @@ -483,7 +480,7 @@ command_all_exec_before_tools_upgrade () exit ;; show ) - command_show + command_show "$@" exit ;; make ) diff --git a/share/bin/portsreinstall-chroot-mount b/share/bin/portsreinstall-chroot-mount index ab4507b..91ca276 100755 --- a/share/bin/portsreinstall-chroot-mount +++ b/share/bin/portsreinstall-chroot-mount @@ -70,7 +70,7 @@ fs_save_current_systembase "${SYSTEMBASE}" # ================================================== main_parse_options_arguments "$@" -shift "${OPTIONS_SHIFT}" +shift "${COMMAND_SHIFT}" opt_invalidate_mount_privilege=no # ======================================================== diff --git a/share/bin/portsreinstall-upgrade b/share/bin/portsreinstall-upgrade index cb6db1e..09d648f 100644 --- a/share/bin/portsreinstall-upgrade +++ b/share/bin/portsreinstall-upgrade @@ -66,7 +66,7 @@ database_maintain_reset_execflag # ================================================== main_parse_options_arguments "$@" -shift "${OPTIONS_SHIFT}" +shift "${COMMAND_SHIFT}" # ======================================================== # ================== SET UP OF PARAMETERS ================== -- 2.11.0