Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] sync-rsync-openpgp-key-path -> generic sync-openpgp-key-path
Date: Tue, 30 Jan 2018 17:32:46
Message-Id: 364e3bd1-0afb-6261-2d8f-6f145ba23c4d@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] sync-rsync-openpgp-key-path -> generic sync-openpgp-key-path by "Michał Górny"
1 On 01/30/2018 08:59 AM, Michał Górny wrote:
2 > Rename the 'sync-rsync-openpgp-key-path' to a more generic
3 > 'sync-openpgp-key-path'. OpenPGP is the basis of at least three
4 > different verification schemes (git, rsync, snapshots) and at least
5 > two of them use the same keys.
6 > ---
7 > cnf/repos.conf | 2 +-
8 > man/portage.5 | 9 +++++----
9 > pym/portage/repository/config.py | 4 ++++
10 > pym/portage/sync/modules/rsync/__init__.py | 1 -
11 > pym/portage/sync/modules/rsync/rsync.py | 8 ++------
12 > 5 files changed, 12 insertions(+), 12 deletions(-)
13 >
14 > diff --git a/cnf/repos.conf b/cnf/repos.conf
15 > index 0d2b1f4be..4a40ff4fc 100644
16 > --- a/cnf/repos.conf
17 > +++ b/cnf/repos.conf
18 > @@ -7,7 +7,7 @@ sync-type = rsync
19 > sync-uri = rsync://rsync.gentoo.org/gentoo-portage
20 > auto-sync = yes
21 > sync-rsync-verify-metamanifest = yes
22 > -sync-rsync-openpgp-key-path = /var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg
23 > +sync-openpgp-key-path = /var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg
24 >
25 > # for daily squashfs snapshots
26 > #sync-type = squashdelta
27 > diff --git a/man/portage.5 b/man/portage.5
28 > index 84999bd2f..1f6259715 100644
29 > --- a/man/portage.5
30 > +++ b/man/portage.5
31 > @@ -1071,10 +1071,11 @@ Extra options to give to rsync on repository synchronization. It takes
32 > precedence over a declaration in [DEFAULT] section, that takes
33 > precedence over PORTAGE_RSYNC_EXTRA_OPTS.
34 > .TP
35 > -.B sync\-rsync\-openpgp\-key\-path
36 > -Path to the OpenPGP key(ring) used to verify MetaManifest. Used only
37 > -if \fBsync\-rsync\-verify\-metamanifest\fR is enabled. If unset,
38 > -the user's keyring is used.
39 > +.B sync\-openpgp\-key\-path
40 > +Path to the OpenPGP key(ring) used to verify received repository. Used
41 > +only for protocols supporting cryptographic verification, provided
42 > +that the respective verification option is enabled. If unset, the user's
43 > +keyring is used.
44 > .TP
45 > .B sync-rsync-vcs-ignore = true|false
46 > Ignore vcs directories that may be present in the repository. It is the
47 > diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
48 > index be31ed3b1..d3a622f7c 100644
49 > --- a/pym/portage/repository/config.py
50 > +++ b/pym/portage/repository/config.py
51 > @@ -86,6 +86,7 @@ class RepoConfig(object):
52 > 'sync_type', 'sync_umask', 'sync_uri', 'sync_user', 'thin_manifest',
53 > 'update_changelog', '_eapis_banned', '_eapis_deprecated',
54 > '_masters_orig', 'module_specific_options', 'manifest_required_hashes',
55 > + 'openpgp_key_path',
56 > )
57 >
58 > def __init__(self, name, repo_opts, local_config=True):
59 > @@ -182,6 +183,9 @@ class RepoConfig(object):
60 > self.strict_misc_digests = repo_opts.get(
61 > 'strict-misc-digests', 'true').lower() == 'true'
62 >
63 > + self.openpgp_key_path = repo_opts.get(
64 > + 'sync-openpgp-key-path', None)
65 > +
66 > self.module_specific_options = {}
67 >
68 > # Not implemented.
69 > diff --git a/pym/portage/sync/modules/rsync/__init__.py b/pym/portage/sync/modules/rsync/__init__.py
70 > index 14af2120c..27a2548c0 100644
71 > --- a/pym/portage/sync/modules/rsync/__init__.py
72 > +++ b/pym/portage/sync/modules/rsync/__init__.py
73 > @@ -27,7 +27,6 @@ module_spec = {
74 > 'validate_config': CheckSyncConfig,
75 > 'module_specific_options': (
76 > 'sync-rsync-extra-opts',
77 > - 'sync-rsync-openpgp-key-path',
78 > 'sync-rsync-vcs-ignore',
79 > 'sync-rsync-verify-jobs',
80 > 'sync-rsync-verify-metamanifest',
81 > diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py
82 > index 552ac6f6b..d9d7d56f2 100644
83 > --- a/pym/portage/sync/modules/rsync/rsync.py
84 > +++ b/pym/portage/sync/modules/rsync/rsync.py
85 > @@ -87,10 +87,6 @@ class RsyncSync(NewBase):
86 > self.verify_metamanifest = (
87 > self.repo.module_specific_options.get(
88 > 'sync-rsync-verify-metamanifest', False))
89 > - # Default to gentoo-keys keyring.
90 > - self.openpgp_key_path = (
91 > - self.repo.module_specific_options.get(
92 > - 'sync-rsync-openpgp-key-path', None))
93 > # Support overriding job count.
94 > self.verify_jobs = self.repo.module_specific_options.get(
95 > 'sync-rsync-verify-jobs', None)
96 > @@ -276,8 +272,8 @@ class RsyncSync(NewBase):
97 > # if synced successfully, verify now
98 > if exitcode == 0 and self.verify_metamanifest:
99 > command = ['gemato', 'verify', '-s', self.repo.location]
100 > - if self.openpgp_key_path is not None:
101 > - command += ['-K', self.openpgp_key_path]
102 > + if self.repo.openpgp_key_path is not None:
103 > + command += ['-K', self.repo.openpgp_key_path]
104 > if self.verify_jobs is not None:
105 > command += ['-j', self.verify_jobs]
106 > exitcode = portage.process.spawn(command, **self.spawn_kwargs)
107 >
108
109 Unless we update this patch to retain backward compatibility with
110 sync-rsync-openpgp-key-path in portage-2.3.21, we'll need a to have a
111 portage-2.3.22 release soon.
112 --
113 Thanks,
114 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies