From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E9541138334 for ; Sat, 28 Jul 2018 06:13:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E9254E083E; Sat, 28 Jul 2018 06:13:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 91118E083E for ; Sat, 28 Jul 2018 06:13:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 051DD335C8E for ; Sat, 28 Jul 2018 06:13:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4456838D for ; Sat, 28 Jul 2018 06:12:58 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1532757283.f810f8694f78dd87172e38d942580532017db4fe.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: misc/, man/, lib/portage/sync/modules/webrsync/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/sync/modules/webrsync/__init__.py lib/portage/sync/modules/webrsync/webrsync.py man/portage.5 misc/emerge-delta-webrsync X-VCS-Directories: misc/ lib/portage/sync/modules/webrsync/ man/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: f810f8694f78dd87172e38d942580532017db4fe X-VCS-Branch: master Date: Sat, 28 Jul 2018 06:12:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8920da7b-b543-4a61-a549-580a1dcdac60 X-Archives-Hash: d41ef1ad6d83ad1d5bf84b45d0f5aae5 commit: f810f8694f78dd87172e38d942580532017db4fe Author: Zac Medico gentoo org> AuthorDate: Fri Jul 27 07:05:03 2018 +0000 Commit: Zac Medico gentoo 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 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 , 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