Skip to content

Commit

Permalink
Call emaint sync --all when using webrsync_gpg
Browse files Browse the repository at this point in the history
  • Loading branch information
sakaki- committed Mar 25, 2017
1 parent f1efba7 commit cee3ae3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
21 changes: 19 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.12"
VERSION="1.0.13"
ETCPROFILE="/etc/profile"
UPDATERSDIR="/etc/${PROGNAME}/updaters.d"
RED_TEXT="" GREEN_TEXT="" YELLOW_TEXT="" RESET_ATTS="" ALERT_TEXT=""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down
19 changes: 17 additions & 2 deletions genup.8
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cee3ae3

Please sign in to comment.