@@ -29,9 +29,10 @@ shopt -s nullglob
2929
3030# ********************** variables *********************
3131PROGNAME=" $( basename " ${0} " ) "
32- VERSION=" 1.0.27 "
32+ VERSION=" 1.0.28 "
3333ETCPROFILE=" /etc/profile"
3434UPDATERSDIR=" /etc/${PROGNAME} /updaters.d"
35+ FIXUPSCRIPT=" /etc/cron.weekly/fixup"
3536RED_TEXT=" " GREEN_TEXT=" " YELLOW_TEXT=" " RESET_ATTS=" " ALERT_TEXT=" "
3637if [[ -v TERM && -n " ${TERM} " && " ${TERM} " != " dumb" ]]; then
3738 RED_TEXT=" $( tput setaf 1) $( tput bold) "
@@ -77,6 +78,7 @@ declare -i ARG_KEEP_OLD_DISTFILES=0
7778declare -i ARG_NO_PERL_CLEANER=0
7879declare -i ARG_NO_EIX_SYNC=0 ARG_ALERT=0
7980declare -i ARG_IGNORE_REQUIRED_CHANGES=0 ARG_NO_CUSTOM_UPDATERS=0
81+ declare -i ARG_NO_FIXUPS=0
8082declare -i ARG_NO_EIX_METADATA_UPDATE=0 ARG_NO_NOCACHE=0
8183declare -i ARG_NO_MODULE_REBUILD=0
8284declare -i ADJUSTMENT=19
@@ -402,6 +404,24 @@ run_custom_updaters_if_present() {
402404 fi
403405 fi
404406}
407+ run_fixups_if_present () {
408+ # if not inhibited, and running on aarch64, and the file
409+ # /etc/cron.weekly/fixup is present and executable, run it: this
410+ # will apply any pending hotfixes, which is generally
411+ # good hygiene to do prior to performing an update (this is
412+ # currently only really of application on RPi systems running
413+ # the gentoo-on-rpi-64bit image)
414+ # NB: we do not treat it as a fatal error if some or all of the
415+ # fixup scripts fail to complete successfully
416+ if (( ARG_NO_FIXUPS== 0 )) && [[ -x " ${FIXUPSCRIPT} " && " aarch64" == " $( uname -m) " ]]; then
417+ show " Running fixup scripts via '${FIXUPSCRIPT} '..."
418+ if ! " ${FIXUPSCRIPT} " ; then
419+ warning " Not all fixups ran successfully!"
420+ warning " Continuing anyway; check the log file"
421+ warning " '/var/log/latest-fixup-run.log' for further details."
422+ fi
423+ fi
424+ }
405425check_if_dispatch_conf_needs_to_be_run () {
406426 # check if the user has any configuration file changes pending review
407427 # by dispatch-conf, and set the NEEDSDISPATCHCONF variable accordingly
@@ -592,6 +612,10 @@ Options:
592612 automatically make necessary changes to config files
593613 -E, --no-emtee don't attempt to use the emtee tool, even when the
594614 eponymous USE flag has been enabled
615+ -F, --no-fixups
616+ do not attempt to run /etc/cron.weekly/fixup, even
617+ where this file is present and executable (fixups
618+ are only in use on aarch64 systems)
595619 -h, --help show this help message and exit
596620 -i, --ignore-required-changes
597621 don't exit with an error in the event that user-driven
@@ -687,7 +711,7 @@ process_command_line_options() {
687711 declare -i RC
688712 set +e
689713 # error trapping off, as we want to handle errors
690- TEMP=" $( getopt -o aAb:cCde:EhikmMnNpr :SvVx: --long ask,alert,buildkernel-args:,dispatch-conf,no-custom-updaters,deploy-from-staging,emerge-args:,no-emtee,help,ignore-required-changes,keep-old-distfiles,no-eix-metadata-update,no-module-rebuild,no-kernel-upgrade,no-nocache,no-perl-cleaner,adjustment:,no-eix-sync,verbose,version,eix-sync-args: -n " ${PROGNAME} " -- " ${@ } " ) "
714+ TEMP=" $( getopt -o aAb:cCde:EFhikmMnNpr :SvVx: --long ask,alert,buildkernel-args:,dispatch-conf,no-custom-updaters,deploy-from-staging,emerge-args:,no-emtee,no-fixups ,help,ignore-required-changes,keep-old-distfiles,no-eix-metadata-update,no-module-rebuild,no-kernel-upgrade,no-nocache,no-perl-cleaner,adjustment:,no-eix-sync,verbose,version,eix-sync-args: -n " ${PROGNAME} " -- " ${@ } " ) "
691715 RC=" ${?} "
692716 set -e
693717 if (( RC!= 0 )) ; then
@@ -714,6 +738,7 @@ process_command_line_options() {
714738 * ) EMERGEARGS=" ${2} " ; shift 2 ;;
715739 esac ;;
716740 -E|--no-emtee) USE_EMTEE=false ; shift ;;
741+ -F|--no-fixups) ARG_NO_FIXUPS=1 ; shift ;;
717742 -h|--help) ARG_HELP=1 ; shift ;;
718743 -i|--ignore-required-changes) ARG_IGNORE_REQUIRED_CHANGES=1 ; shift ;;
719744 -k|--keep-old-distfiles) ARG_KEEP_OLD_DISTFILES=1 ; shift ;;
@@ -786,6 +811,7 @@ display_greeting
786811check_gcc_config_and_reset_if_necessary
787812update_portage_tree_and_sync_eix
788813remove_any_prior_emerge_resume_history
814+ run_fixups_if_present
789815ensure_portage_itself_is_up_to_date
790816ensure_genup_itself_is_up_to_date
791817try_emtee_update_if_enabled
0 commit comments