From d33fb4dcef65adf6d37838d799a974f3a4ee740a Mon Sep 17 00:00:00 2001 From: sakaki Date: Tue, 23 Apr 2019 23:56:53 +0100 Subject: [PATCH] Bump version to 1.0.20 (add optional emtee support) --- README.md | 2 +- genup | 30 ++++++++++++++++++++++++++++-- genup.8 | 20 +++++++++++++++++--- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index da75103..0765edc 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Tool to update the **Portage**(5) tree, all installed packages, and kernel, unde * ensures **genup** itself is up-to-date (restarting if not) (using `emerge --oneshot --update genup`) * updates all packages in the @world set -(using `emerge --deep --with-bdeps=y --changed-use --update @world`) +(first using `emtee`, if the matching USE flag is set, and then using `emerge --deep --with-bdeps=y --changed-use --update @world`) * removes unreferenced packages (using `emerge --depclean`) * rebuilds any external modules (such as those for VirtualBox) diff --git a/genup b/genup index dcbfa39..381d9d7 100755 --- a/genup +++ b/genup @@ -29,7 +29,7 @@ shopt -s nullglob # ********************** variables ********************* PROGNAME="$(basename "${0}")" -VERSION="1.0.19" +VERSION="1.0.20" ETCPROFILE="/etc/profile" UPDATERSDIR="/etc/${PROGNAME}/updaters.d" RED_TEXT="" GREEN_TEXT="" YELLOW_TEXT="" RESET_ATTS="" ALERT_TEXT="" @@ -47,6 +47,9 @@ SHOWSUFFIX="" # following variable is conformed on installation by ebuild # (to reflect setting of "buildkernel" USE flag) USE_BUILDKERNEL=true +# following variable is conformed on installation by ebuild +# (to reflect setting of "emtee" USE flag) +USE_EMTEE=false VERBOSITYFLAG="" ASKFLAG="" ALERTFLAG="" @@ -246,6 +249,25 @@ ensure_genup_itself_is_up_to_date() { fi } +try_emtee_update_if_enabled() { + # if the emtee USE flag is enabled, then try doing an initial + # @world update with this tool; it is considerably less + # resource intensive in some update situations (and can + # also sometimes compute a successful update in cases where + # a vanilla emerge -DuU --with-bdeps=y @world fails) + if "${USE_EMTEE}"; then + # this is allowed to fail, since we'll try a full @world + # emerge afterwards anyhow + show "Attempting to update @world set (for new versions, or changed use flags)" + show "using emtee..." + if ${PUMP} emtee ${ASKFLAG} ${ALERTFLAG} ${VERBOSITYFLAG} --emerge-args="${EMERGEARGS}"; then + show "emtee run completed successfully!" + else + warning "emtee @world build did not complete successfully!" + fi + fi +} + update_all_packages_in_world_set_and_dependencies() { # performs deep dependency tree update, including build-time dependencies # will update any package whose use flags have changed @@ -530,6 +552,8 @@ Options: pass provided additional ARGS to the main emerge e.g., use --emerge-args='--autounmask-write' to automatically make necessary changes to config files + -E, --no-emtee don't attempt to use the emtee tool, even when the + eponymous USE flag has been enabled -h, --help show this help message and exit -i, --ignore-required-changes don't exit with an error in the event that user-driven @@ -618,7 +642,7 @@ process_command_line_options() { declare -i RC set +e # error trapping off, as we want to handle errors - TEMP="$(getopt -o aAb:cCde:hiknpr:SvVx: --long ask,alert,buildkernel-args:,dispatch-conf,no-custom-updaters,deploy-from-staging,emerge-args:,help,ignore-required-changes,keep-old-distfiles,no-kernel-upgrade,no-perl-cleaner,adjustment:,no-eix-sync,verbose,version,eix-sync-args: -n "${PROGNAME}" -- "${@}")" + TEMP="$(getopt -o aAb:cCde:Ehiknpr: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-kernel-upgrade,no-perl-cleaner,adjustment:,no-eix-sync,verbose,version,eix-sync-args: -n "${PROGNAME}" -- "${@}")" RC="${?}" set -e if ((RC!=0)); then @@ -644,6 +668,7 @@ process_command_line_options() { "") shift 2 ;; *) EMERGEARGS="${2}" ; shift 2 ;; esac ;; + -E|--no-emtee) USE_EMTEE=false ; shift ;; -h|--help) ARG_HELP=1 ; shift ;; -i|--ignore-required-changes) ARG_IGNORE_REQUIRED_CHANGES=1 ; shift ;; -k|--keep-old-distfiles) ARG_KEEP_OLD_DISTFILES=1 ; shift ;; @@ -711,6 +736,7 @@ update_portage_tree_and_sync_eix remove_any_prior_emerge_resume_history ensure_portage_itself_is_up_to_date ensure_genup_itself_is_up_to_date +try_emtee_update_if_enabled update_all_packages_in_world_set_and_dependencies remove_unreferenced_packages rebuild_external_modules_if_necessary diff --git a/genup.8 b/genup.8 index 02540bf..58f1c8b 100644 --- a/genup.8 +++ b/genup.8 @@ -1,4 +1,4 @@ -.TH GENUP 8 "Version 1.0.19: March 2019" +.TH GENUP 8 "Version 1.0.20: April 2019" .SH NAME genup \- update Portage tree, all installed packages, and kernel .SH SYNOPSIS @@ -31,7 +31,7 @@ ensures genup itself is up-to-date (restarting if not) .IP \(bu 2 updates all packages in the @world set .br -(using \fBemerge --deep --with-bdeps=y --changed-use --update @world\fR) +(first using \fBemtee\fR, if the matching USE flag is set, and then using \fBemerge --deep --with-bdeps=y --changed-use --update @world\fR) .IP \(bu 2 removes unreferenced packages .br @@ -173,6 +173,10 @@ the \fBdispatch-conf\fR(1) mechanism). Note also that if you do use this approach, you should also specify the \fB--ignore-required-changes\fR option. .TP +.BR \-E ", " \-\-no\-emtee +Do not attempt to use the \fBemtee\fR(1) tool, even when the +eponymous USE flag has been enabled. +.TP .BR \-h ", " \-\-help Displays a short help screen, and exits. .TP @@ -270,6 +274,15 @@ is always forced on, and as such \fBbuildkernel\fR(8). This makes it suitable for use in an embedded context (where there may be no EFI system partition etc.). + +If the \fBemtee\fR USE flag is set when \fBgenup\fR is emerged +(it is \fIun\fRset by default), then the \fB@world\fR update will first be +attempted using the (often, more efficient) \fBemtee\fR tool. This behaviour +may always be suppressed by using the \fB--no-emtee\fR option. Note that even when +\fBemtee\fR \fIis\fR used, and even when it returns successfully, a regular +\fB@world\fR \fBemerge\fR will always still be attempted immediately afterwards +(nomally a relatively rapid no-op, this behaviour ensures all corner cases are +resoved correctly). .SH EXTENDING GENUP At the end of the main process, \fBgenup\fR will attempt to run any executable files found in the \fI/etc/genup/updaters.d\fR directory @@ -298,7 +311,7 @@ NB: most users will \fBnot\fR have the webrsync-gpg FEATURE set, and so should i this note. .SH COPYRIGHT .nf -Copyright \(co 2014-2018 sakaki +Copyright \(co 2014-2019 sakaki License GPLv3+ (GNU GPL version 3 or later) @@ -311,6 +324,7 @@ sakaki \(em send bug reports or comments to .BR dispatch-conf (1), .BR eclean (1), .BR emerge (1), +.BR emtee (1), .BR eix (1), .BR eix-sync (1), .BR emaint (1),