From cee3ae350b1d96a08f4a4a305ef12d0064b4ee61 Mon Sep 17 00:00:00 2001 From: sakaki Date: Sat, 25 Mar 2017 10:09:37 +0000 Subject: [PATCH] Call emaint sync --all when using webrsync_gpg --- genup | 21 +++++++++++++++++++-- genup.8 | 19 +++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/genup b/genup index 3d4ac71..b1b4616 100755 --- a/genup +++ b/genup @@ -29,7 +29,7 @@ shopt -s nullglob # ********************** variables ********************* PROGNAME="$(basename "${0}")" -VERSION="1.0.12" +VERSION="1.0.13" ETCPROFILE="/etc/profile" UPDATERSDIR="/etc/${PROGNAME}/updaters.d" RED_TEXT="" GREEN_TEXT="" YELLOW_TEXT="" RESET_ATTS="" ALERT_TEXT="" @@ -65,6 +65,7 @@ export NUMCPUSPLUSONE=$(( NUMCPUS + 1 )) export MAKEOPTS="${MAKEOPTS--j${NUMCPUSPLUSONE} -l${NUMCPUS}}" export EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS---jobs=${NUMCPUSPLUSONE} --load-average=${NUMCPUS}}" declare -i KERNELBUILT=0 KERNELDEPLOYED=0 NEEDSDISPATCHCONF=0 +declare -i WEBRSYNC=0 # program arguments (booleans in this case) declare -i ARG_ASK=0 ARG_DEPLOYFROMSTAGING=0 ARG_HELP=0 ARG_NO_KERNEL_UPGRADE=0 declare -i ARG_VERBOSE=0 ARG_VERSION=0 ARG_DISPATCHCONF=0 @@ -182,12 +183,27 @@ display_greeting() { } update_portage_tree_and_sync_eix() { if ((ARG_NO_EIX_SYNC==0)); then + if ((WEBRSYNC==1)); then + # eix-sync will ignore other overlays in webrsync-gpg mode, so + # force them to update, and do this first, so changes are picked up + # by eix-update + # NB - make sure you have the "gentoo" overlay set to + # auto-sync = no in /etc/portage/repos.conf/gentoo.conf, otherwise + # it will also be rsync'd by the below, which is probably not + # 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 + fi show "Updating Portage tree and syncing the eix cache" show "(this may take some time)..." # do this quietly, to avoid flooding the logs / screen eix-sync -q ${EIXSYNCARGS} else warning "As requested, not performing eix-sync" + if ((WEBRSYNC==1)); then + warning "(also suppressing emaint sync --auto)" + fi fi } remove_any_prior_emerge_resume_history() { @@ -500,7 +516,7 @@ Options: -r, --adjustment=N add integer N to the build niceness -20<=N<=19 (the default is 19, running builds at lowest possible system priority to avoid slowing the system too much) - -S, --no-eix-sync do not attempt to run eix-sync + -S, --no-eix-sync do not attempt to run emaint sync --auto or eix-sync -v, --verbose ask called programs to display more information -V, --version display the version number of ${PROGNAME} and exit EOF @@ -552,6 +568,7 @@ check_if_using_webrsync_gpg() { # force use of emerge-webrsync instead of emerge --sync show "Portage feature webrsync-gpg detected: using -w option with eix-sync" EIXSYNCARGS="-w" + WEBRSYNC=1 fi } check_if_using_distcc() { diff --git a/genup.8 b/genup.8 index 793d3d4..aa08a8a 100644 --- a/genup.8 +++ b/genup.8 @@ -1,4 +1,4 @@ -.TH GENUP 8 "Version 1.0.12: January 2017" +.TH GENUP 8 "Version 1.0.13: March 2017" .SH NAME genup \- update Portage tree, all installed packages, and kernel .SH SYNOPSIS @@ -15,7 +15,7 @@ When invoked, it automatically performs the following steps, in order: updates Portage tree & overlays; syncs \fBeix\fR(1) (if desired) .br -(using \fBeix-sync\fR) +(using (if needed) \fBemaint sync --auto\fR, and \fBeix-sync\fR) .IP \(bu 2 removes any prior \fBemerge\fR(1) resume history; .br @@ -265,6 +265,21 @@ exit status, \fBgenup\fR will also exit (immediately) with a failure code. Note that you can suppress the running of custom updaters, by passing the \fB--no-custom-updaters\fR option to \fBgenup\fR. +.SH USE WITH WEBRSYNC-GPG +If you have the webrsync-gpg FEATURE enabled in \fI/etc/portage/make.conf\fR, +\fBgenup\fR will select the -w option when calling \fBeix-sync\fR. +Since, in this +mode, \fBeix-sync\fR does not automatically sync (non-layman) overlays, +\fBgenup\fR will +call \fBemaint sync --auto\fR to do this for you, before \fBeix-sync\fR. + +As such, you must make sure you have set "auto-sync = no" in +\fI/etc/portage/repos.conf/gentoo.conf\fR when using the webrsync-gpg FEATURE, +to prevent \fBemaint sync --auto\fR from also updating the main gentoo repo +using rsync (which will almost certainly not be what you want). + +NB: most users will \fBnot\fR have the webrsync-gpg FEATURE set, and so should ignore +this note. .SH COPYRIGHT .nf Copyright \(co 2014-2017 sakaki