From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: misc/, man/, lib/portage/sync/modules/webrsync/
Date: Sat, 28 Jul 2018 06:12:58 +0000 (UTC) [thread overview]
Message-ID: <1532757283.f810f8694f78dd87172e38d942580532017db4fe.zmedico@gentoo> (raw)
commit: f810f8694f78dd87172e38d942580532017db4fe
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 27 07:05:03 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 28 05:54:43 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f810f869
webrsync: support emerge-delta-webrsync (bug 661838)
Add a repos.conf sync-webrsync-delta setting that makes the webrsync
module call emerge-delta-webrsync, so that emerge-delta-webrsync users
can benefit from sync-openpgp-key-path support in the webrsync module.
Bug: https://bugs.gentoo.org/661838
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>
lib/portage/sync/modules/webrsync/__init__.py | 1 +
lib/portage/sync/modules/webrsync/webrsync.py | 10 ++++++++++
man/portage.5 | 4 ++++
misc/emerge-delta-webrsync | 17 ++++++++++++++++-
4 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/lib/portage/sync/modules/webrsync/__init__.py b/lib/portage/sync/modules/webrsync/__init__.py
index 118e752de..a413553a1 100644
--- a/lib/portage/sync/modules/webrsync/__init__.py
+++ b/lib/portage/sync/modules/webrsync/__init__.py
@@ -46,6 +46,7 @@ module_spec = {
},
'validate_config': CheckSyncConfig,
'module_specific_options': (
+ 'sync-webrsync-delta',
'sync-webrsync-keep-snapshots',
'sync-webrsync-verify-signature',
),
diff --git a/lib/portage/sync/modules/webrsync/webrsync.py b/lib/portage/sync/modules/webrsync/webrsync.py
index 1b4c08e65..609ba0be2 100644
--- a/lib/portage/sync/modules/webrsync/webrsync.py
+++ b/lib/portage/sync/modules/webrsync/webrsync.py
@@ -34,6 +34,16 @@ class WebRsync(SyncBase):
def __init__(self):
SyncBase.__init__(self, 'emerge-webrsync', '>=sys-apps/portage-2.3')
+ @property
+ def has_bin(self):
+ if (self._bin_command != 'emerge-delta-webrsync' and
+ self.repo.module_specific_options.get(
+ 'sync-webrsync-delta', 'false').lower() in ('true', 'yes')):
+ self._bin_command = 'emerge-delta-webrsync'
+ self.bin_command = portage.process.find_binary(self._bin_command)
+ self.bin_pkg = '>=app-portage/emerge-delta-webrsync-3.7.5'
+
+ return super(WebRsync, self).has_bin
def sync(self, **kwargs):
'''Sync the repository'''
diff --git a/man/portage.5 b/man/portage.5
index 4cb1b0b34..cd9d5036d 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1128,6 +1128,10 @@ when 0. Defaults to disabled.
Require the repository to contain a signed MetaManifest and verify
it using \fBapp\-portage/gemato\fR. Defaults to no.
.TP
+.B sync\-webrsync\-delta = true|false
+Use \fBapp\-portage/emerge\-delta\-webrsync\fR to minimize bandwidth.
+Defaults to false.
+.TP
.B sync\-webrsync\-keep\-snapshots = true|false
Keep snapshots in \fBDISTDIR\fR (do not delete). Defaults to false.
.TP
diff --git a/misc/emerge-delta-webrsync b/misc/emerge-delta-webrsync
index ebaa616f9..14e5c7c55 100755
--- a/misc/emerge-delta-webrsync
+++ b/misc/emerge-delta-webrsync
@@ -4,7 +4,15 @@
# Author: Brian Harring <ferringb@gentoo.org>, karltk@gentoo.org originally.
# Rewritten from the old, Perl-based emerge-webrsync script
+# repos.conf configuration for use with emerge --sync and emaint sync
+# using keyring from app-crypt/openpgp-keys-gentoo-release:
+# [gentoo]
+# sync-type = webrsync
+# sync-webrsync-delta = true
+# sync-webrsync-verify-signature = true
+# sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc
#
+# Alternative (legacy) PORTAGE_GPG_DIR configuration:
# gpg key import
# KEY_ID=0x96D8BF6D
# gpg --homedir /etc/portage/gnupg --keyserver subkeys.pgp.net --recv-keys $KEY_ID
@@ -106,7 +114,14 @@ if [[ ! -d $STATE_DIR ]]; then
exit -2
fi
-if has webrsync-gpg ${FEATURES} ; then
+if has $(__repo_attr "${repo_name}" sync-webrsync-verify-signature | \
+ LC_ALL=C tr '[:upper:]' '[:lower:]') true yes; then
+ if [[ ! -d ${PORTAGE_GPG_DIR} ]]; then
+ eecho "Do not call ${argv0##*/} directly, instead call emerge --sync or emaint sync."
+ exit 1
+ fi
+ WEBSYNC_VERIFY_SIGNATURE=1
+elif has webrsync-gpg ${FEATURES}; then
WEBSYNC_VERIFY_SIGNATURE=1
else
WEBSYNC_VERIFY_SIGNATURE=0
reply other threads:[~2018-07-28 6:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1532757283.f810f8694f78dd87172e38d942580532017db4fe.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox