• R/O
  • HTTP
  • SSH
  • HTTPS

current: Commit

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


Commit MetaInfo

Revision15e593436cad817d57ed4b01a95411bbf3bfe057 (tree)
Time2018-09-12 01:02:40
AuthorMamoru Sakaue / MwGhennndo <glmwghennndo@user...>
CommiterMamoru Sakaue / MwGhennndo

Log Message

Fixed bugs related to portsreinstall packupgrade and portsreinstall-upgrade.

Changes to be committed:

modified: lib/chroot-mount/liboptions.sh
modified: lib/chroot/libcommand.sh
modified: lib/chroot/libcommand_do.sh
modified: lib/libcommand.sh
modified: lib/libcommand_pkgs.sh
modified: lib/libmain.sh
modified: lib/libpkgsys.sh
modified: lib/main/libcommand.sh
modified: lib/main/liboptions.sh
modified: lib/upgrade/libcommand.sh
modified: lib/upgrade/libcommand_do.sh
modified: lib/upgrade/liboptions.sh
modified: share/bin/portsreinstall-chroot-mount

Change Summary

Incremental Difference

--- a/lib/chroot-mount/liboptions.sh
+++ b/lib/chroot-mount/liboptions.sh
@@ -22,3 +22,10 @@ J just-save-options opt_just_save_options no yes
2222 S no-opening-message opt_no_opening_message no yes
2323 eof
2424 }
25+
26+# ============= Regularize the option value =============
27+options_regularize ()
28+{
29+ opt_packages_dir=`fs_global_path "$opt_packages_dir"`
30+ opt_invalidate_mount_privilege=no
31+}
--- a/lib/chroot/libcommand.sh
+++ b/lib/chroot/libcommand.sh
@@ -108,12 +108,12 @@ command_all_exec_before_tools_upgrade ()
108108 case $COMMAND_MODE in
109109 clean )
110110 database_maintain_clean
111- message_echo "Done"
111+ [ $opt_no_opening_message = yes ] || message_echo "Done"
112112 exit
113113 ;;
114114 destroy )
115115 database_maintain_destroy
116- message_echo "Done"
116+ [ $opt_no_opening_message = yes ] || message_echo "Done"
117117 exit
118118 ;;
119119 unmount )
@@ -125,7 +125,7 @@ command_all_exec_before_tools_upgrade ()
125125 fs_build_chroot
126126 fs_mount
127127 temp_reset_termination_messages_common
128- message_echo "Done"
128+ [ $opt_no_opening_message = yes ] || message_echo "Done"
129129 exit
130130 ;;
131131 enter )
@@ -152,7 +152,7 @@ command_all_exec_before_tools_upgrade ()
152152 fs_build_chroot
153153 fs_mount
154154 command_do_update_host_files
155- message_echo "Done"
155+ [ $opt_no_opening_message = yes ] || message_echo "Done"
156156 exit
157157 ;;
158158 esac
--- a/lib/chroot/libcommand_do.sh
+++ b/lib/chroot/libcommand_do.sh
@@ -347,26 +347,24 @@ command_do_chroot_update_host_pkgs ()
347347 PROGRAM_DEPENDS='UPDATE_HOST'
348348 _program_exec_and_record_completion__operation ()
349349 {
350+ local storedir
350351 message_section_title "Extract the upgrade archive"
351- (
352- cd "$opt_basedir"/store
353- rm -rf work
354- mkdir work
355- tar xzf portsreinstall-upgrade.tar.gz -C work
356- )
352+ storedir=$opt_basedir/store
353+ rm -rf "$storedir/work"
354+ mkdir "$storedir/work"
355+ tar xzf "$storedir/portsreinstall-upgrade.tar.gz" -C "$storedir/work"
356+ message_echo
357357 }
358358 program_exec_and_record_completion EXTRACT_SCRIPT_ARCHIVE
359359 PROGRAM_DEPENDS='EXTRACT_SCRIPT_ARCHIVE'
360360 _program_exec_and_record_completion__operation ()
361361 {
362+ local opt_quiet
362363 message_section_title "Update the packages at the host environment"
363- (
364- cd "$opt_basedir"/store
365- opt_quiet=
366- [ $opt_batch_mode = yes ] && opt_quiet='-a '
367- work/portsreinstall-upgrade -S clean
368- work/portsreinstall-upgrade -S $opt_quiet -P "${PACKAGES}/${PKGREPOSITORYSUBDIR}"
369- )
364+ opt_quiet=
365+ [ $opt_batch_mode = yes ] && opt_quiet='-a '
366+ $opt_basedir/store/work/portsreinstall-upgrade -S clean
367+ $opt_basedir/store/work/portsreinstall-upgrade -S $opt_quiet -P "${PACKAGES}/${PKGREPOSITORYSUBDIR}"
370368 }
371369 program_exec_and_record_completion UPGRADE_HOST
372370 }
--- a/lib/libcommand.sh
+++ b/lib/libcommand.sh
@@ -61,6 +61,7 @@ command_all_parse_args ()
6161 # ============= Notify that option settings are reset =============
6262 command_exec_without_pkgtools__notify_reset_options ()
6363 {
64+ [ $opt_no_opening_message = yes ] && return
6465 message_echo "NOTE: Option settings are ignored (because of no effect) and reset."
6566 }
6667
--- a/lib/libcommand_pkgs.sh
+++ b/lib/libcommand_pkgs.sh
@@ -401,7 +401,6 @@ command_pkgs_packupgrade_create__pack ()
401401 install -m 444 "${MYPREFIX}/man/man8/${PROGRAM}-upgrade.8.gz" "$dstdir/man/man8"
402402 tar czf "$dstdir.tar.gz" -C "$dstdir" .
403403 touch "$dstdir/complete"
404- message_echo
405404 }
406405 program_exec_and_record_completion COMMAND_PACKUPGRADE_PACK
407406 }
@@ -441,6 +440,7 @@ command_pkgs_packupgrade_crop ()
441440 fi
442441 cp "$dstdir.tar.gz" "${COMMAND_PACKUPGRADE_SAVEPATH}"
443442 message_echo "INFO: The cropped archive is saved as [${COMMAND_PACKUPGRADE_SAVEPATH}]."
443+ message_echo
444444 }
445445
446446 # ============= Operation of make command =============
--- a/lib/libmain.sh
+++ b/lib/libmain.sh
@@ -12,7 +12,7 @@ main_set_version ()
1212 MYVERSION=4.1.0
1313 COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$'
1414 # Template for development versions
15- MYVERSION=4.0.0+toward_4.1.0_20180911205455
15+ MYVERSION=4.0.0+toward_4.1.0_20180912000219
1616 COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
1717 }
1818
--- a/lib/libpkgsys.sh
+++ b/lib/libpkgsys.sh
@@ -486,7 +486,7 @@ pkgsys_def_pkgtools ()
486486 {
487487 local opt_del opt_quit dev_out dev_err
488488 opt_del=
489- [ $no_exec_inst_script = yes ] && opt_del='-D'
489+ [ $opt_no_exec_inst_script = yes ] && opt_del='-D'
490490 opt_quit=
491491 dev_out=/dev/stdout
492492 dev_err=/dev/stderr
@@ -550,7 +550,7 @@ pkgsys_def_pkgtools ()
550550 rm -rf "${TMPDIR}/pkg_add_f"
551551 mkdir -p "${TMPDIR}/pkg_add_f"
552552 opt_add=
553- [ $no_exec_inst_script = yes ] && opt_add='-I'
553+ [ $opt_no_exec_inst_script = yes ] && opt_add='-I'
554554 opt_quit=
555555 dev_out=/dev/stdout
556556 dev_err=/dev/stderr
@@ -602,7 +602,7 @@ pkgsys_def_pkgtools ()
602602 rm -rf "${TMPDIR}/pkg_inst_remote"
603603 mkdir -p "${TMPDIR}/pkg_inst_remote"
604604 opt_add=
605- [ $no_exec_inst_script = yes ] && opt_add='-I'
605+ [ $opt_no_exec_inst_script = yes ] && opt_add='-I'
606606 opt_quit=
607607 dev_out=/dev/stdout
608608 dev_err=/dev/stderr
@@ -650,7 +650,7 @@ pkgsys_def_pkgtools ()
650650 rm -rf "${TMPDIR}/pkg_inst_remote_wild"
651651 mkdir -p "${TMPDIR}/pkg_inst_remote_wild"
652652 opt_add=
653- [ $no_exec_inst_script = yes ] && opt_add='-I'
653+ [ $opt_no_exec_inst_script = yes ] && opt_add='-I'
654654 dev_out=/dev/stdout
655655 dev_err=/dev/stderr
656656 if [ $opt_batch_mode = yes ]
@@ -892,7 +892,7 @@ pkgsys_def_pkgtools ()
892892 {
893893 local opt_del dev_out dev_err
894894 opt_del=
895- [ $no_exec_inst_script = yes ] && opt_del='-D'
895+ [ $opt_no_exec_inst_script = yes ] && opt_del='-D'
896896 dev_out=/dev/stdout
897897 dev_err=/dev/stderr
898898 if [ $opt_batch_mode = yes ]
@@ -909,7 +909,7 @@ pkgsys_def_pkgtools ()
909909 mkdir -p "${TMPDIR}/pkg_add_f"
910910 ln -s "$@" "${TMPDIR}/pkg_add_f"
911911 opt_add=
912- [ $no_exec_inst_script = yes ] && opt_add='-I'
912+ [ $opt_no_exec_inst_script = yes ] && opt_add='-I'
913913 dev_out=/dev/stdout
914914 dev_err=/dev/stderr
915915 if [ $opt_batch_mode = yes ]
@@ -926,7 +926,7 @@ pkgsys_def_pkgtools ()
926926 mkdir -p "${TMPDIR}/pkg_add_f"
927927 ln -s "$@" "${TMPDIR}/pkg_add_f"
928928 opt_add=
929- [ $no_exec_inst_script = yes ] && opt_add='-I'
929+ [ $opt_no_exec_inst_script = yes ] && opt_add='-I'
930930 dev_out=/dev/stdout
931931 dev_err=/dev/stderr
932932 if [ $opt_batch_mode = yes ]
@@ -967,7 +967,7 @@ pkgsys_def_pkgtools ()
967967 mkdir -p "${TMPDIR}/pkg_inst_remote"
968968 ln -s "$@" "${TMPDIR}/pkg_add_f"
969969 opt_add=
970- [ $no_exec_inst_script = yes ] && opt_add='-I'
970+ [ $opt_no_exec_inst_script = yes ] && opt_add='-I'
971971 dev_out=/dev/stdout
972972 dev_err=/dev/stderr
973973 if [ $opt_batch_mode = yes ]
--- a/lib/main/libcommand.sh
+++ b/lib/main/libcommand.sh
@@ -29,7 +29,7 @@ command_all_exec_before_db_creation ()
2929 force )
3030 message_echo "INFO: The temporary database is tried to be cleaned up without checking the privilege."
3131 database_maintain_clean_all
32- message_echo "Done"
32+ [ $opt_no_opening_message = yes ] || message_echo "Done"
3333 exit
3434 ;;
3535 esac
@@ -293,12 +293,6 @@ command_all_parse_args ()
293293 COMMAND_SHIFT=$(($num_args_init - $#))
294294 }
295295
296-# ============= Notify that option settings are reset =============
297-command_exec_without_pkgtools__notify_reset_options ()
298-{
299- message_echo "NOTE: Option settings are ignored (because of no effect) and reset."
300-}
301-
302296 # ============= Execute command operations which do not need package tools =============
303297 command_all_exec_without_pkgtools ()
304298 {
@@ -315,7 +309,7 @@ command_all_exec_without_pkgtools ()
315309 database_maintain_load "$COMMAND_LOAD_FILE"
316310 ;;
317311 esac
318- message_echo "Done"
312+ [ $opt_no_opening_message = yes ] || message_echo "Done"
319313 exit
320314 ;;
321315 esac
@@ -394,7 +388,7 @@ command_all_exec_irrespective_of_saved_options ()
394388 arcfile=`realpath "$COMMAND_SAVE_DIR"`/${APPNAME}_`date +%Y%m%d_%H%M%S`.tar.gz
395389 message_echo "Starting to save the temporary database as [$arcfile]..."
396390 database_maintain_save "$arcfile"
397- message_echo "Done"
391+ [ $opt_no_opening_message = yes ] || message_echo "Done"
398392 exit
399393 ;;
400394 glob )
@@ -449,7 +443,7 @@ command_all_exec_irrespective_of_saved_options ()
449443 command_pkgs_packupgrade
450444 ;;
451445 esac
452- message_echo "Done"
446+ [ $opt_no_opening_message = yes ] || message_echo "Done"
453447 exit
454448 ;;
455449 redo )
@@ -467,12 +461,12 @@ command_all_exec_before_tools_upgrade ()
467461 message_echo "Starting to reset the temporary database by preserving the initial snapshot of installed packages..."
468462 if [ ! -d "${DBDIR}" ]
469463 then
470- message_echo "INFO: No temporary database is built yet."
464+ [ $opt_no_opening_message = yes ] || message_echo "INFO: No temporary database is built yet."
471465 else
472466 database_maintain_reset "$COMMAND_OPERATION"
473- message_echo "INFO: Option settings and taboo/freeze/need/noneed lists are preserved."
467+ [ $opt_no_opening_message = yes ] || message_echo "INFO: Option settings and taboo/freeze/need/noneed lists are preserved."
474468 fi
475- message_echo "Done"
469+ [ $opt_no_opening_message = yes ] || message_echo "Done"
476470 exit
477471 ;;
478472 options )
--- a/lib/main/liboptions.sh
+++ b/lib/main/liboptions.sh
@@ -52,7 +52,7 @@ l use-legacy-package-for-missing-pkgng opt_use_legacy_pkg_for_missing_pkgng no y
5252 f disallow-force-continuation-for-looped-dependency opt_disallow_force_continuation_for_looped_dependency no yes
5353 j delete-then-reinstall opt_delete_then_reinstall no yes
5454 F fetch-only opt_fetch_only no yes
55-x no-exec-inst-script no_exec_inst_script no yes
55+x no-exec-inst-script opt_no_exec_inst_script no yes
5656 eof
5757 }
5858
--- a/lib/upgrade/libcommand.sh
+++ b/lib/upgrade/libcommand.sh
@@ -48,9 +48,9 @@ command_all_exec_without_pkgtools ()
4848 case $COMMAND_MODE in
4949 clean )
5050 command_exec_without_pkgtools__notify_reset_options
51- message_echo "Starting to clean up the temporary database..."
51+ [ $opt_no_opening_message = yes ] || message_echo "Starting to clean up the temporary database..."
5252 database_maintain_clean_all
53- message_echo "Done"
53+ [ $opt_no_opening_message = yes ] || message_echo "Done"
5454 exit
5555 ;;
5656 esac
--- a/lib/upgrade/libcommand_do.sh
+++ b/lib/upgrade/libcommand_do.sh
@@ -78,7 +78,7 @@ command_do_reinst_ports ()
7878 then
7979 datetime_init=`expr "$timestamp_init" : '[^:]*:\([0-9]*\)' || :`
8080 datetime_fin=`expr "$timestamp_fin" : '[^:]*:\([0-9]*\)' || :`
81- [ -n "$datetime_init" -a -n "$datetime_fin" -a "$datetime_init" -ge "$datetime_fin" ] && break
81+ [ -n "$datetime_init" -a -n "$datetime_fin" -a "$datetime_init" -ge "$datetime_fin" ] && return
8282 fi
8383 fi
8484 case $cmd in
--- a/lib/upgrade/liboptions.sh
+++ b/lib/upgrade/liboptions.sh
@@ -46,4 +46,5 @@ eof
4646 options_regularize ()
4747 {
4848 opt_packages_dir=`fs_global_path "$opt_packages_dir"`
49+ opt_no_exec_inst_script=no
4950 }
--- a/share/bin/portsreinstall-chroot-mount
+++ b/share/bin/portsreinstall-chroot-mount
@@ -72,7 +72,6 @@ fs_save_current_systembase "${SYSTEMBASE}"
7272 main_parse_options_arguments "$@"
7373 shift "${OPTIONS_SHIFT}"
7474 shift "${COMMAND_SHIFT}"
75-opt_invalidate_mount_privilege=no
7675
7776 # ========================================================
7877 # ================== SET UP OF PARAMETERS ==================
Show on old repository browser