• R/O
  • HTTP
  • SSH
  • HTTPS

current: Commit

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


Commit MetaInfo

Revision438c5584eee21927623692f3e1c7996a7f517aa4 (tree)
Time2018-09-14 12:17:01
AuthorMamoru Sakaue / MwGhennndo <glmwghennndo@user...>
CommiterMamoru Sakaue / MwGhennndo

Log Message

Fixed bugs about freezing.

Changes to be committed:

modified: HISTORY
modified: lib/libcommand_flexconf.sh
modified: lib/libmain.sh
modified: lib/libpkgsys.sh
modified: lib/libreinstall.sh

Change Summary

Incremental Difference

--- a/HISTORY
+++ b/HISTORY
@@ -12,7 +12,7 @@
1212 [IMPROVED] It is changed to detect unflavored ports or ports with old flavor names of flavored ports as obsolete.
1313 [IMPROVED] The behavior with union file systems is stabilized.
1414 [IMPROVED] It is changed to show messages of reset ports at the stage of reloading ${LOCALBASE}/etc/portsreinstall.conf.
15-[IMPROVED] It is changed so that ports to freeze are upgraded to the latest available package version.
15+[IMPROVED] It is changed so that ports to freeze are upgraded to the latest available package version and deemed success.
1616 [IMPROVED] It is changed to unlock in all error termination.
1717 [IMPROVED] Inside- and outside-parent jail/chroot mounting/unmounting operations by portsreinstall-chroot(8) and portsreinstall-chroot-mount(8) are now safely protected from each other.
1818 [IMPROVED] The message at the exit from portsreinstall-chroot(8) builder chroot environment is modified to be less shocking.
--- a/lib/libcommand_flexconf.sh
+++ b/lib/libcommand_flexconf.sh
@@ -81,10 +81,11 @@ command_flexconf_update_taboo ()
8181 # ============= Register/deregister freeze ports in the command line form =============
8282 command_flexconf_update_freeze ()
8383 {
84- local COMMAND_OPERATION evalated_globs
84+ local COMMAND_OPERATION evalated_globs tmp_list
8585 COMMAND_OPERATION=$1
8686 shift || :
8787 evalated_globs=`str_linearize_list_and "$@"`
88+ tmp_list=${TMPDIR}/command_flexconf_update_freeze
8889 case $COMMAND_OPERATION in
8990 add )
9091 pkgsys_register_evaluated_globs add "${DBDIR}/freeze.list" "$@"
@@ -95,7 +96,22 @@ command_flexconf_update_freeze ()
9596 message_echo "$evalated_globs is/are deregistered from the list of ports to freeze."
9697 ;;
9798 esac
99+ cat "${DBDIR}/freeze.all.list" 2> /dev/null > $tmp_list:old || :
98100 fileedit_combine_lists "${DBDIR}/conf/FREEZE:PORTS.parsed" "${DBDIR}/freeze.list" > ${DBDIR}/freeze.all.list
101+ rm -f "$tmp_list:exists_update"
102+ {
103+ grep -vFx -f "$tmp_list:old" "${DBDIR}/freeze.all.list"
104+ grep -vFx -f "${DBDIR}/freeze.all.list" "$tmp_list:old"
105+ } | while read origin
106+ do
107+ touch "$tmp_list:exists_update"
108+ database_build_patch_reconf "$origin"
109+ done
110+ if [ -e "$tmp_list:exists_update" ]
111+ then
112+ program_deregister_stage_complete PREPARE_FOR_INSPECT_ALL_DEPENDENCIES
113+ program_deregister_stage_complete ALL_COMPLETE
114+ fi
99115 if [ `cat "${DBDIR}/freeze.all.list" 2> /dev/null | wc -l` -gt 0 ]
100116 then
101117 message_echo "Now the following ports are registered to be freeze:"
--- 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_20180914003252
15+ MYVERSION=4.0.0+toward_4.1.0_20180914121445
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
@@ -12,7 +12,6 @@ PKGSYS_CMD_PKG_DELETE='pkg delete' # Corresponding command for pkg_delete
1212 PKGSYS_AVR_REFETCH_TIMES_PER_SITE=1 # Average number (integer) of retrials for retrieving package or distfiles per mirror site
1313 PKGSYS_AVR_REFETCH_TIMES_FOR_CHKSUMERR=2 # Number (integer) of retrials for check sum error in retrieving a package
1414
15-
1615 # ============= Get the time stamp of the ports tree =============
1716 pkgsys_get_timestamp_portstree ()
1817 {
@@ -689,8 +688,8 @@ pkgsys_def_pkgtools ()
689688 origin=$1
690689 origin_unflavored=`expr "$origin" : '\([^@]*\)'` || return
691690 [ -n "$origin_unflavored" ] || return
692- pkg fetch -qyU "$origin_unflavored" 2> /dev/null || return
693- pkg=`pkg rquery -U %n-%v "$origin_unflavored" 2> /dev/null` || return
691+ pkg fetch -qyU "$origin_unflavored" || return
692+ pkg=`pkg rquery -U %n-%v "$origin_unflavored"` || return
694693 echo "$pkg"
695694 }
696695 pkg_get_pkgs_timestamps ()
--- a/lib/libreinstall.sh
+++ b/lib/libreinstall.sh
@@ -804,7 +804,7 @@ reinstall_execcmd_getstdout_errlog ()
804804 {
805805 local func
806806 func=$1
807- if $func > $REINSTALL_DBNODE_DIR/error.log 2>&1
807+ if $func 2> $REINSTALL_DBNODE_DIR/error.log
808808 then
809809 rm -f "$REINSTALL_DBNODE_DIR/error.log"
810810 return
@@ -886,6 +886,12 @@ reinstall_exec_chk_skip ()
886886 reinstall_skip 'Skipped because already upgraded with a prebuilt package'
887887 return 1
888888 fi
889+ if [ -e "$REINSTALL_DBNODE_DIR/installed_by_freezing" ]
890+ then
891+ reinstall_restore_if_temporarily_deinstalled
892+ reinstall_skip 'Skipped because the reinstallation has been deemed already completed by freezing'
893+ return 1
894+ fi
889895 reinstall_skip_if_in_a_list 'Skipped because the reinstallation has been already completed' \
890896 "success.${REINSTALL_DBSUFFIX}.list" restore && return 1
891897 if [ $opt_skip_unchanged = yes ]
@@ -1024,7 +1030,14 @@ reinstall_exec_reinstall_by_pkg ()
10241030 then
10251031 if [ $REINSTALL_IS_FROZEN = yes ]
10261032 then
1027- pkg=`pkg_get_remote_repository_version "$REINSTALL_ORIGIN" || :`
1033+ pkg=`pkg_get_remote_repository_version "$REINSTALL_ORIGIN" 2> /dev/null || :`
1034+ if [ -z "$pkg" ]
1035+ then
1036+ message_echo "WARNING: No package for $REINSTALL_ORIGIN is found in the repository." >&2
1037+ elif [ "$pkg" != "$REINSTALL_NEWPKGNAME" ]
1038+ then
1039+ message_echo "WARNING: (For freezing) A different package version ($pkg) is found for $REINSTALL_ORIGIN in the repository." >&2
1040+ fi
10281041 else
10291042 pkg=$REINSTALL_NEWPKGNAME
10301043 fi
@@ -1035,7 +1048,7 @@ reinstall_exec_reinstall_by_pkg ()
10351048 else
10361049 reinstall_register_stage in_bypkg
10371050 fi
1038- if ! reinstall_chk_stage_complete INSTALL_BY_PKG
1051+ if [ -n "$pkg" ] && [ "$pkg" = "$REINSTALL_NEWPKGNAME" ] && ! reinstall_chk_stage_complete INSTALL_BY_PKG
10391052 then
10401053 if ! reinstall_chk_stage FAILED_INSTALL_BY_PKG
10411054 then
@@ -1122,6 +1135,9 @@ reinstall_exec_reinstall_by_pkg ()
11221135 if [ $opt_fetch_only = yes ]
11231136 then
11241137 message_echo "INFO: Continue to fetch distfiles in case of installation by port."
1138+ elif [ $REINSTALL_IS_FROZEN = yes ]
1139+ then
1140+ message_echo "WARNING: Correct (re)installation-by-package is unsuccessful, so retrying to freeze." >&2
11251141 else
11261142 message_echo "WARNING: (Re)installation-by-package is unsuccessful, so retrying by using port." >&2
11271143 fi
@@ -1153,8 +1169,9 @@ reinstall_exec_reinstall_freeze_if_necessary ()
11531169 message_echo "INFO: The latest repository version $pkg installed, deemed success."
11541170 message_echo "WARNING: This action may cause problems due to the version/option mismatch." >&2
11551171 reinstall_tell_update_to_depandents
1172+ touch "$REINSTALL_DBNODE_DIR/installed_by_freezing"
11561173 reinstall_closing_operations_after_successful_install
1157- return 1
1174+ return
11581175 fi
11591176 message_echo "INFO: The latest repository version $pkg will be installed."
11601177 reinstall_pkg_backup || :
@@ -1167,6 +1184,7 @@ reinstall_exec_reinstall_freeze_if_necessary ()
11671184 message_echo "INFO: Deemed success."
11681185 message_echo "WARNING: This action may cause problems due to the version/option mismatch." >&2
11691186 reinstall_tell_update_to_depandents
1187+ touch "$REINSTALL_DBNODE_DIR/installed_by_freezing"
11701188 reinstall_closing_operations_after_successful_install
11711189 return
11721190 fi
@@ -1175,7 +1193,7 @@ reinstall_exec_reinstall_freeze_if_necessary ()
11751193 reinstall_restore_if_temporarily_deinstalled
11761194 reinstall_errproc 'freezing'
11771195 reinstall_skip 'Skipped because being a port to freeze.'
1178- return
1196+ return 1
11791197 }
11801198
11811199 # ============= Reinstallation of the current origin: Avoid build if any requirement port to freeze is unfrozen =============
@@ -1648,6 +1666,7 @@ reinstall_exec_reinstall ()
16481666 if [ $REINSTALL_IS_FROZEN = yes ]
16491667 then
16501668 reinstall_exec_reinstall_freeze_if_necessary || return
1669+ return
16511670 fi
16521671 reinstall_exec_reinstall_avoid_if_any_unfrozen_requirements_exists || return
16531672 reinstall_exec_reinstall_prebuild || return
@@ -1684,7 +1703,6 @@ reinstall_exec ()
16841703 REINSTALL_NEWPKGNAME=`database_build_get_new_pkgname "$REINSTALL_ORIGIN"`
16851704 REINSTALL_IS_FROZEN=no
16861705 grep -qFx "$REINSTALL_ORIGIN" "${DBDIR}/freeze.all.list" 2> /dev/null && REINSTALL_IS_FROZEN=yes
1687- set +x
16881706 message_stage_title "$PROGRAM_STEP_COUNTER $REINSTALL_ORIGPKGTAG"
16891707 reinstall_exec_chk_skip && reinstall_exec_reinstall || :
16901708 message_echo
Show on old repository browser