Skip to content

Commit

Permalink
Bump version to 1.0.20 (add optional emtee support)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakaki- committed Apr 23, 2019
1 parent 4d587b7 commit d33fb4d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
30 changes: 28 additions & 2 deletions genup
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand All @@ -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=""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 ;;
Expand Down Expand Up @@ -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
Expand Down
20 changes: 17 additions & 3 deletions genup.8
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
<http://gnu.org/licenses/gpl.html>

Expand All @@ -311,6 +324,7 @@ sakaki \(em send bug reports or comments to <[email protected]>
.BR dispatch-conf (1),
.BR eclean (1),
.BR emerge (1),
.BR emtee (1),
.BR eix (1),
.BR eix-sync (1),
.BR emaint (1),
Expand Down

0 comments on commit d33fb4d

Please sign in to comment.