From fdd79110c03a54a8a48a38aac9b4626dbadeb2f8 Mon Sep 17 00:00:00 2001 From: Mamoru Sakaue / MwGhennndo Date: Tue, 21 Aug 2018 00:19:24 +0800 Subject: [PATCH] Some bug fiz related to the previously added new features. Changes to be committed: modified: bin/portsreinstall-chroot modified: lib/chroot/libcommand.sh modified: lib/chroot/libcommand_do.sh modified: lib/chroot/libmain.sh modified: lib/libcommand_do.sh modified: lib/libmain.sh modified: man/portsreinstall-chroot.8 --- bin/portsreinstall-chroot | 3 +-- lib/chroot/libcommand.sh | 3 ++- lib/chroot/libcommand_do.sh | 39 +++++++++++++++++++++++++++++++-------- lib/chroot/libmain.sh | 4 +++- lib/libcommand_do.sh | 2 +- lib/libmain.sh | 2 +- man/portsreinstall-chroot.8 | 2 +- 7 files changed, 40 insertions(+), 15 deletions(-) diff --git a/bin/portsreinstall-chroot b/bin/portsreinstall-chroot index 02168ed..f4facbf 100755 --- a/bin/portsreinstall-chroot +++ b/bin/portsreinstall-chroot @@ -79,8 +79,7 @@ fs_safeguard_basedir "$opt_basedir" pkgsys_load_portsnap_conf main_setup_parameters "$@" -fs_inspect_fs_privilege -main_set_termination_messages_after_mount_fs +main_inspect_fs_privilege main_operation_without_pkg_management_tools "$@" diff --git a/lib/chroot/libcommand.sh b/lib/chroot/libcommand.sh index cb5e728..23a3aa0 100644 --- a/lib/chroot/libcommand.sh +++ b/lib/chroot/libcommand.sh @@ -127,7 +127,8 @@ command_all_exec_main () command_do_pre command_do_starter_portsnap command_do_starter_pkg - command_do_starter_init_resinst + command_do_starter_clean + command_do_main_init_resinst command_do_chroot_enter_if_incomplete command_do_post command_do_ending_process diff --git a/lib/chroot/libcommand_do.sh b/lib/chroot/libcommand_do.sh index 3a8ab56..b99094d 100644 --- a/lib/chroot/libcommand_do.sh +++ b/lib/chroot/libcommand_do.sh @@ -93,7 +93,8 @@ eof command_do_update_host_files () { local dirpath filepath - message_echo "Updating the files affecting package installation (packages, distfiles, port options, ports/packages management tools configurations) of the host environment..." + message_section_title "Update the files affecting package installation of the host environment" + message_echo "INFO: targets are packages, distfiles, port options and ports/packages management tools configurations" for dirpath in "${DISTDIR}" "${PACKAGES}" "${PORT_DBDIR}" do ( @@ -123,7 +124,7 @@ command_do_update_host_files () rm -f $filepath fi done - : + message_echo } # ============= Ending process ============= @@ -219,16 +220,38 @@ command_do_starter_pkg () program_exec_and_record_completion STARTER_GUEST_PKG_REPO } -# ============= Starter process in the chroot environment: Initiate the reinstallation process ============= -command_do_starter_init_resinst () +# ============= Starter process in the chroot environment: Clean the temporary database ============= +command_do_starter_clean () { local PROGRAM_DEPENDS PROGRAM_DEPENDS='STARTER_GUEST_PKG_REPO' _program_exec_and_record_completion__operation () { + local opts + [ $opt_fullcourse = no ] && return + message_section_title "Full course starter: Clean the temporary database" + if [ $opt_batch_mode = no ] + then + opts= + else + opts='-q' + fi + chroot "$opt_basedir"/builder /usr/bin/env ${PROGRAM} $opts clean force + message_echo + } + program_exec_and_record_completion STARTER_GUEST_CLEAN +} + +# ============= Main process in the chroot environment: Initiate the reinstallation process ============= +command_do_main_init_resinst () +{ + local PROGRAM_DEPENDS + PROGRAM_DEPENDS='STARTER_GUEST_CLEAN' + _program_exec_and_record_completion__operation () + { local exitstatus [ $opt_fullcourse = no ] && return - message_section_title "Full course starter: Initiate the reinstallation process" + message_section_title "Full course main: Initiate the reinstallation process" if [ $opt_batch_mode = no ] then opts='-CGSYjqx' @@ -313,7 +336,7 @@ command_do_chroot_pack_update () PROGRAM_DEPENDS='UPGRADE_GUEST' _program_exec_and_record_completion__operation () { - message_echo "Packing the upgrades..." + message_section_title "Pack the upgrades" [ $opt_batch_mode = yes ] && opt_quiet='-a ' chroot "$opt_basedir"/builder /bin/csh -c "${PROGRAM} -S $opt_quiet packupgrade create && ${PROGRAM} -S $opt_quiet packupgrade crop /.${PROGRAM}" } @@ -339,7 +362,7 @@ command_do_chroot_update_host_pkgs () PROGRAM_DEPENDS='UPDATE_HOST' _program_exec_and_record_completion__operation () { - message_echo "Extracting the upgrade archive..." + message_section_title "Extract the upgrade archive" ( cd "$opt_basedir"/store rm -rf work @@ -351,7 +374,7 @@ command_do_chroot_update_host_pkgs () PROGRAM_DEPENDS='EXTRACT_SCRIPT_ARCHIVE' _program_exec_and_record_completion__operation () { - message_echo "Updating the packages at the host environment..." + message_section_title "Update the packages at the host environment" ( cd "$opt_basedir"/store opt_quiet= diff --git a/lib/chroot/libmain.sh b/lib/chroot/libmain.sh index 2f04638..8757346 100644 --- a/lib/chroot/libmain.sh +++ b/lib/chroot/libmain.sh @@ -8,8 +8,10 @@ # ============================================================================== # ============= Set termination messages which should be shown after mounting file systems ============= -main_set_termination_messages_after_mount_fs () +main_inspect_fs_privilege () { + fs_inspect_fs_privilege + message_echo temp_terminate_process () { local errno diff --git a/lib/libcommand_do.sh b/lib/libcommand_do.sh index b9d10db..c666b02 100644 --- a/lib/libcommand_do.sh +++ b/lib/libcommand_do.sh @@ -1385,7 +1385,7 @@ command_do_main () # Deinstallation of unused obsolete and leaf packages command_do_deinstallation_of_unused_obsolete_and_leaf_packages - elif + else # Deinstallation of unused obsolete and leaf packages command_do_deinstallation_of_unused_obsolete_and_leaf_packages diff --git a/lib/libmain.sh b/lib/libmain.sh index 4b24009..81bf918 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_20180819211059 + MYVERSION=4.0.0+toward_4.1.0_20180821001856 COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$' } diff --git a/man/portsreinstall-chroot.8 b/man/portsreinstall-chroot.8 index 605f098..3706aef 100644 --- a/man/portsreinstall-chroot.8 +++ b/man/portsreinstall-chroot.8 @@ -195,7 +195,7 @@ The delimiter is comma (",") by default and changeable by \fB\-E\fR option. .PD 0 .TP \fB\-\-fullcourse\fR -Carry out the \fBdo\fR process as the "full course" automatic mode where operation in the builder \fBchroot\fR(8) environment is initiated by update of the ports tree and package repository followed by execution of \fBportsreinstall\fR(8) initiated with option \fB\-CGSYjqx\fR (\fB\-CGSajqx\fR if \fB\-a\fR option is set). +Carry out the \fBdo\fR process as the "full course" automatic mode where operation in the builder \fBchroot\fR(8) environment is initiated by update of the ports tree and package repository followed by cleaning of the temporary database and execution of \fBportsreinstall\fR(8) initiated with option \fB\-CGSYjqx\fR (\fB\-CGSajqx\fR if \fB\-a\fR option is set). Resuming \fBdo\fR command automatically executes \fBportsreinstall\fR(8) in the builder \fBchroot\fR(8) environment. With \fB\-a\fR option, the all detected leaf and obsolete packages will be deleted. .PD -- 2.11.0