Skip to content

Commit

Permalink
Bump version to 1.0.21 (eix-sync -0 and nocache support)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakaki- committed Apr 26, 2019
1 parent f814389 commit 2819f9c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Tool to update the **Portage**(5) tree, all installed packages, and kernel, unde
(using `buildkernel --copy-from-staging`)
* updates environment settings (as a precautionary measure)
(using `env-update`)
* updates `eix` package metadata
(using `eix-sync -0`)
* runs any custom updaters in /etc/genup/updaters.d

The genup utility can be invoked in non-interative (default) or interactive mode (see the **--ask** option in the manpage). Non-interactive mode is suitable for use in a scripted invocation, for example as part of a nightly **cron**(8) job.
Expand Down
36 changes: 32 additions & 4 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.20"
VERSION="1.0.21"
ETCPROFILE="/etc/profile"
UPDATERSDIR="/etc/${PROGNAME}/updaters.d"
RED_TEXT="" GREEN_TEXT="" YELLOW_TEXT="" RESET_ATTS="" ALERT_TEXT=""
Expand Down Expand Up @@ -62,6 +62,11 @@ PUMP=""
NOPUMP="-distcc -distcc-pump"
PORTAGEINFO=""
PORTAGEFEATURES=""
USE_NOCACHE=false
NOCACHE=""
if "${USE_NOCACHE}"; then
NOCACHE="nocache"
fi
# following should already be in the environment; but to be safe...
if [[ ! -v NUMCPUS ]]; then
export NUMCPUS=$(grep -E 'processor\s+:' /proc/cpuinfo | wc -l)
Expand All @@ -84,6 +89,7 @@ declare -i ARG_KEEP_OLD_DISTFILES=0
declare -i ARG_NO_PERL_CLEANER=0
declare -i ARG_NO_EIX_SYNC=0 ARG_ALERT=0
declare -i ARG_IGNORE_REQUIRED_CHANGES=0 ARG_NO_CUSTOM_UPDATERS=0
declare -i ARG_NO_EIX_METADATA_UPDATE=0 ARG_NO_NOCACHE=0
declare -i ADJUSTMENT=19
# force TERM if none found (e.g. when running from cron)
# otherwise mach builds (firefox etc.) will fail
Expand Down Expand Up @@ -212,13 +218,13 @@ update_portage_tree_and_sync_eix() {
# what you want when webrsync-gpg is in use
show "Running emaint sync --auto to update overlays"
show "(make sure you have auto-sync = no in gentoo.conf)..."
emaint sync --auto
${NOCACHE} emaint sync --auto
fi
show "Updating Portage tree and syncing the eix cache"
show "(this may take some time)..."
# no longer explicitly set -q
# (user can still do so via --eix-sync-args)
eix-sync ${EIXSYNCARGS}
${NOCACHE} eix-sync ${EIXSYNCARGS}
else
warning "As requested, not performing eix-sync"
if ((WEBRSYNC==1)); then
Expand Down Expand Up @@ -475,6 +481,17 @@ update_environment() {
# /etc/ld.so.cache)
env-update
}
update_eix_metadata() {
# ensure eix metadata is up-to-date (will not be if
# only non-gentoo repos have changed in this run)
if ((ARG_NO_EIX_METADATA_UPDATE==0)); then
# following does not hit the network
show "Updating eix metadata..."
eix-sync -0
else
warning "As requested, not updating eix metadata"
fi
}
remove_unreferenced_packages() {
# following should be reasonably safe, it removes any packages that are not
# required by the transitive closure of @world set dependencies
Expand Down Expand Up @@ -562,9 +579,14 @@ Options:
-k, --keep-old-distfiles
don't purge source tarballs (distfiles) for uninstalled
versions of packages (or uninstalled packages)
-m, --no-eix-metadata-update
don't attempt to update eix metadata at the
completion of the run
-n, --no-kernel-upgrade
do not attempt to run buildkernel (implied if
buildkernel USE flag has not been set)
-N, --no--nocache do not attempt to use nocache with eix-sync, even
when the nocache USE flag has been set
-p, --no-perl-cleaner do not attempt to run perl-cleaner
-r, --adjustment=N add integer N to the build niceness -20<=N<=19
(the default is 19, running builds at lowest possible
Expand Down Expand Up @@ -642,7 +664,7 @@ process_command_line_options() {
declare -i RC
set +e
# error trapping off, as we want to handle errors
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}" -- "${@}")"
TEMP="$(getopt -o aAb:cCde:EhikmnNpr: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-kernel-upgrade,no-nocache,no-perl-cleaner,adjustment:,no-eix-sync,verbose,version,eix-sync-args: -n "${PROGNAME}" -- "${@}")"
RC="${?}"
set -e
if ((RC!=0)); then
Expand Down Expand Up @@ -672,7 +694,9 @@ process_command_line_options() {
-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 ;;
-m|--no-eix-metadata-update) ARG_NO_EIX_METADATA_UPDATE=1 ; shift ;;
-n|--no-kernel-upgrade) ARG_NO_KERNEL_UPGRADE=1 ; shift ;;
-N|--no-nocache) ARG_NO_NOCACHE=1 ; shift ;;
-p|--no-perl-cleaner) ARG_NO_PERL_CLEANER=1 ; shift ;;
-r|--adjustment)
case "${2}" in
Expand Down Expand Up @@ -722,6 +746,9 @@ process_command_line_options() {
if ! "${USE_BUILDKERNEL}"; then
ARG_NO_KERNEL_UPGRADE=1
fi
if ((ARG_NO_NOCACHE==1)); then
NOCACHE=""
fi
internal_consistency_option_checks
}

Expand Down Expand Up @@ -751,6 +778,7 @@ rebuild_packages_depending_on_stale_libraries
purge_old_distfiles_if_desired
copy_new_kernel_from_staging_if_present_and_desired
update_environment
update_eix_metadata
run_custom_updaters_if_present
display_final_status
cleanup_and_exit_with_code 0
Expand Down
24 changes: 23 additions & 1 deletion genup.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH GENUP 8 "Version 1.0.20: April 2019"
.TH GENUP 8 "Version 1.0.21: April 2019"
.SH NAME
genup \- update Portage tree, all installed packages, and kernel
.SH SYNOPSIS
Expand Down Expand Up @@ -84,6 +84,12 @@ deploys new kernel from staging (if desired and available)
updates environment settings (as a precautionary measure)
.br
(using \fBenv-update\fR)

.IP \(bu 2
updates the \fBeix\fR(1) package metadata (if desired)
.br
(using \fBeix-sync -0\fR)

.IP \(bu 2
runs any custom updaters in \fI/etc/genup/updaters.d\fR
.PP
Expand Down Expand Up @@ -198,6 +204,11 @@ been downloaded by Portage, but which do not relate to the installed version of
any package.
This option inhibits such cleaning.
.TP
.BR \-m ", " \-\-no\-eix\-metadata\-update
Do not perform an update of the \fBeix\fR metadata at the end-of-run (NB, specifying
this may cause odd results to be reported when using the \fBeix\fR tool
subsequently).
.TP
.BR \-n ", " \-\-no\-kernel\-upgrade
Do not perform (in non-interactive mode) or offer to perform (in interactive
mode) a kernel recompile, even should a newer version be available.
Expand All @@ -206,6 +217,10 @@ This option is implied if the \fBbuildkernel\fR USE flag is unset.
Note, this does \fBnot\fR itself prevent the update of \fBgentoo-sources\fR (or similar
package), during the @world \fBemerge\fR(1) step.
.TP
.BR \-N ", " \-\-no\-nocache
Do not attempt to use \fBnocache\fR(1) with \fBeix-sync\fR(1), even when
the \fBnocache\fR USE flag is set.
.TP
.BR \-p ", " \-\-no\-perl\-cleaner
Do not attempt to run \fBperl-cleaner\fR(1) during the process.
.TP
Expand Down Expand Up @@ -283,6 +298,12 @@ may always be suppressed by using the \fB--no-emtee\fR option. Note that even wh
\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).

If the \fBnocache\fR USE flag is set when \fBgenup\fR is emerged
(it is \fIun\fRset by default), then all repo sync steps will be prefixed
by \fBnocache\fR, which can prevent overswapping etc. on limited
memory systems. This behaviour may always be suppressed by using the
\fB--no-nocache\fR option.
.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 @@ -329,6 +350,7 @@ sakaki \(em send bug reports or comments to <sakaki@deciban.com>
.BR eix-sync (1),
.BR emaint (1),
.BR nice (1),
.BR nocache (1),
.BR make (1),
.BR python (1),
.BR perl-cleaner (1),
Expand Down

0 comments on commit 2819f9c

Please sign in to comment.