This is for active development.
New funtionalities are to be added actively.
Revision | 438c5584eee21927623692f3e1c7996a7f517aa4 (tree) |
---|---|
Time | 2018-09-14 12:17:01 |
Author | Mamoru Sakaue / MwGhennndo <glmwghennndo@user...> |
Commiter | Mamoru Sakaue / MwGhennndo |
Fixed bugs about freezing.
modified: HISTORY
modified: lib/libcommand_flexconf.sh
modified: lib/libmain.sh
modified: lib/libpkgsys.sh
modified: lib/libreinstall.sh
@@ -12,7 +12,7 @@ | ||
12 | 12 | [IMPROVED] It is changed to detect unflavored ports or ports with old flavor names of flavored ports as obsolete. |
13 | 13 | [IMPROVED] The behavior with union file systems is stabilized. |
14 | 14 | [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. | |
16 | 16 | [IMPROVED] It is changed to unlock in all error termination. |
17 | 17 | [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. |
18 | 18 | [IMPROVED] The message at the exit from portsreinstall-chroot(8) builder chroot environment is modified to be less shocking. |
@@ -81,10 +81,11 @@ command_flexconf_update_taboo () | ||
81 | 81 | # ============= Register/deregister freeze ports in the command line form ============= |
82 | 82 | command_flexconf_update_freeze () |
83 | 83 | { |
84 | - local COMMAND_OPERATION evalated_globs | |
84 | + local COMMAND_OPERATION evalated_globs tmp_list | |
85 | 85 | COMMAND_OPERATION=$1 |
86 | 86 | shift || : |
87 | 87 | evalated_globs=`str_linearize_list_and "$@"` |
88 | + tmp_list=${TMPDIR}/command_flexconf_update_freeze | |
88 | 89 | case $COMMAND_OPERATION in |
89 | 90 | add ) |
90 | 91 | pkgsys_register_evaluated_globs add "${DBDIR}/freeze.list" "$@" |
@@ -95,7 +96,22 @@ command_flexconf_update_freeze () | ||
95 | 96 | message_echo "$evalated_globs is/are deregistered from the list of ports to freeze." |
96 | 97 | ;; |
97 | 98 | esac |
99 | + cat "${DBDIR}/freeze.all.list" 2> /dev/null > $tmp_list:old || : | |
98 | 100 | 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 | |
99 | 115 | if [ `cat "${DBDIR}/freeze.all.list" 2> /dev/null | wc -l` -gt 0 ] |
100 | 116 | then |
101 | 117 | message_echo "Now the following ports are registered to be freeze:" |
@@ -12,7 +12,7 @@ main_set_version () | ||
12 | 12 | MYVERSION=4.1.0 |
13 | 13 | COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$' |
14 | 14 | # Template for development versions |
15 | - MYVERSION=4.0.0+toward_4.1.0_20180914003252 | |
15 | + MYVERSION=4.0.0+toward_4.1.0_20180914121445 | |
16 | 16 | COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$' |
17 | 17 | } |
18 | 18 |
@@ -12,7 +12,6 @@ PKGSYS_CMD_PKG_DELETE='pkg delete' # Corresponding command for pkg_delete | ||
12 | 12 | PKGSYS_AVR_REFETCH_TIMES_PER_SITE=1 # Average number (integer) of retrials for retrieving package or distfiles per mirror site |
13 | 13 | PKGSYS_AVR_REFETCH_TIMES_FOR_CHKSUMERR=2 # Number (integer) of retrials for check sum error in retrieving a package |
14 | 14 | |
15 | - | |
16 | 15 | # ============= Get the time stamp of the ports tree ============= |
17 | 16 | pkgsys_get_timestamp_portstree () |
18 | 17 | { |
@@ -689,8 +688,8 @@ pkgsys_def_pkgtools () | ||
689 | 688 | origin=$1 |
690 | 689 | origin_unflavored=`expr "$origin" : '\([^@]*\)'` || return |
691 | 690 | [ -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 | |
694 | 693 | echo "$pkg" |
695 | 694 | } |
696 | 695 | pkg_get_pkgs_timestamps () |
@@ -804,7 +804,7 @@ reinstall_execcmd_getstdout_errlog () | ||
804 | 804 | { |
805 | 805 | local func |
806 | 806 | func=$1 |
807 | - if $func > $REINSTALL_DBNODE_DIR/error.log 2>&1 | |
807 | + if $func 2> $REINSTALL_DBNODE_DIR/error.log | |
808 | 808 | then |
809 | 809 | rm -f "$REINSTALL_DBNODE_DIR/error.log" |
810 | 810 | return |
@@ -886,6 +886,12 @@ reinstall_exec_chk_skip () | ||
886 | 886 | reinstall_skip 'Skipped because already upgraded with a prebuilt package' |
887 | 887 | return 1 |
888 | 888 | 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 | |
889 | 895 | reinstall_skip_if_in_a_list 'Skipped because the reinstallation has been already completed' \ |
890 | 896 | "success.${REINSTALL_DBSUFFIX}.list" restore && return 1 |
891 | 897 | if [ $opt_skip_unchanged = yes ] |
@@ -1024,7 +1030,14 @@ reinstall_exec_reinstall_by_pkg () | ||
1024 | 1030 | then |
1025 | 1031 | if [ $REINSTALL_IS_FROZEN = yes ] |
1026 | 1032 | 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 | |
1028 | 1041 | else |
1029 | 1042 | pkg=$REINSTALL_NEWPKGNAME |
1030 | 1043 | fi |
@@ -1035,7 +1048,7 @@ reinstall_exec_reinstall_by_pkg () | ||
1035 | 1048 | else |
1036 | 1049 | reinstall_register_stage in_bypkg |
1037 | 1050 | fi |
1038 | - if ! reinstall_chk_stage_complete INSTALL_BY_PKG | |
1051 | + if [ -n "$pkg" ] && [ "$pkg" = "$REINSTALL_NEWPKGNAME" ] && ! reinstall_chk_stage_complete INSTALL_BY_PKG | |
1039 | 1052 | then |
1040 | 1053 | if ! reinstall_chk_stage FAILED_INSTALL_BY_PKG |
1041 | 1054 | then |
@@ -1122,6 +1135,9 @@ reinstall_exec_reinstall_by_pkg () | ||
1122 | 1135 | if [ $opt_fetch_only = yes ] |
1123 | 1136 | then |
1124 | 1137 | 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 | |
1125 | 1141 | else |
1126 | 1142 | message_echo "WARNING: (Re)installation-by-package is unsuccessful, so retrying by using port." >&2 |
1127 | 1143 | fi |
@@ -1153,8 +1169,9 @@ reinstall_exec_reinstall_freeze_if_necessary () | ||
1153 | 1169 | message_echo "INFO: The latest repository version $pkg installed, deemed success." |
1154 | 1170 | message_echo "WARNING: This action may cause problems due to the version/option mismatch." >&2 |
1155 | 1171 | reinstall_tell_update_to_depandents |
1172 | + touch "$REINSTALL_DBNODE_DIR/installed_by_freezing" | |
1156 | 1173 | reinstall_closing_operations_after_successful_install |
1157 | - return 1 | |
1174 | + return | |
1158 | 1175 | fi |
1159 | 1176 | message_echo "INFO: The latest repository version $pkg will be installed." |
1160 | 1177 | reinstall_pkg_backup || : |
@@ -1167,6 +1184,7 @@ reinstall_exec_reinstall_freeze_if_necessary () | ||
1167 | 1184 | message_echo "INFO: Deemed success." |
1168 | 1185 | message_echo "WARNING: This action may cause problems due to the version/option mismatch." >&2 |
1169 | 1186 | reinstall_tell_update_to_depandents |
1187 | + touch "$REINSTALL_DBNODE_DIR/installed_by_freezing" | |
1170 | 1188 | reinstall_closing_operations_after_successful_install |
1171 | 1189 | return |
1172 | 1190 | fi |
@@ -1175,7 +1193,7 @@ reinstall_exec_reinstall_freeze_if_necessary () | ||
1175 | 1193 | reinstall_restore_if_temporarily_deinstalled |
1176 | 1194 | reinstall_errproc 'freezing' |
1177 | 1195 | reinstall_skip 'Skipped because being a port to freeze.' |
1178 | - return | |
1196 | + return 1 | |
1179 | 1197 | } |
1180 | 1198 | |
1181 | 1199 | # ============= Reinstallation of the current origin: Avoid build if any requirement port to freeze is unfrozen ============= |
@@ -1648,6 +1666,7 @@ reinstall_exec_reinstall () | ||
1648 | 1666 | if [ $REINSTALL_IS_FROZEN = yes ] |
1649 | 1667 | then |
1650 | 1668 | reinstall_exec_reinstall_freeze_if_necessary || return |
1669 | + return | |
1651 | 1670 | fi |
1652 | 1671 | reinstall_exec_reinstall_avoid_if_any_unfrozen_requirements_exists || return |
1653 | 1672 | reinstall_exec_reinstall_prebuild || return |
@@ -1684,7 +1703,6 @@ reinstall_exec () | ||
1684 | 1703 | REINSTALL_NEWPKGNAME=`database_build_get_new_pkgname "$REINSTALL_ORIGIN"` |
1685 | 1704 | REINSTALL_IS_FROZEN=no |
1686 | 1705 | grep -qFx "$REINSTALL_ORIGIN" "${DBDIR}/freeze.all.list" 2> /dev/null && REINSTALL_IS_FROZEN=yes |
1687 | - set +x | |
1688 | 1706 | message_stage_title "$PROGRAM_STEP_COUNTER $REINSTALL_ORIGPKGTAG" |
1689 | 1707 | reinstall_exec_chk_skip && reinstall_exec_reinstall || : |
1690 | 1708 | message_echo |