1 |
On Tue, Jan 16, 2018 at 11:43 AM, Michał Górny <mgorny@g.o> wrote: |
2 |
|
3 |
> Include a repo.postsync.d hook to verify the rsync checkout using |
4 |
> gemato. Given that not all people will want to have it enabled |
5 |
> unconditionally, no setup.py rules are included -- instead, the file |
6 |
> would be installed conditionally by the ebuild. |
7 |
> |
8 |
> [v2: included link to the wiki page] |
9 |
> --- |
10 |
> MANIFEST.in | 2 +- |
11 |
> misc/repo.postsync.d/00gemato | 18 ++++++++++++++++++ |
12 |
> 2 files changed, 19 insertions(+), 1 deletion(-) |
13 |
> create mode 100644 misc/repo.postsync.d/00gemato |
14 |
> |
15 |
> diff --git a/MANIFEST.in b/MANIFEST.in |
16 |
> index 4f6cac162..edc6704e7 100644 |
17 |
> --- a/MANIFEST.in |
18 |
> +++ b/MANIFEST.in |
19 |
> @@ -14,4 +14,4 @@ include cnf/make.conf.example.* |
20 |
> include .portage_not_installed |
21 |
> |
22 |
> # extra scripts |
23 |
> -include misc/* |
24 |
> +graft misc |
25 |
> diff --git a/misc/repo.postsync.d/00gemato b/misc/repo.postsync.d/00gemato |
26 |
> new file mode 100644 |
27 |
> index 000000000..f2af50925 |
28 |
> --- /dev/null |
29 |
> +++ b/misc/repo.postsync.d/00gemato |
30 |
> @@ -0,0 +1,18 @@ |
31 |
> +#!/bin/bash |
32 |
> +# repo.postsync.d hook to verify ::gentoo checkout using gemato |
33 |
> + |
34 |
> +name=${1} |
35 |
> +url=${2} |
36 |
> +path=${3} |
37 |
> + |
38 |
> +# keyring installed by gentoo-keys |
39 |
> +openpgp_key=/var/lib/gentoo/gkeys/keyrings/gentoo/release/pubring.gpg |
40 |
> |
41 |
|
42 |
This seems a bit leaky to me. |
43 |
|
44 |
Possible to get gentoo-keys to print it? |
45 |
|
46 |
e.g: |
47 |
|
48 |
openpgp_key=$(gentoo-keys --print-key-path) |
49 |
|
50 |
Or its fine if we think it won't move around. I guess that is mostly up to |
51 |
dol-sen? :) |
52 |
|
53 |
-A |
54 |
|
55 |
|
56 |
> + |
57 |
> +# apply only to ::gentoo, when synced over rsync. |
58 |
> +if [[ ${name} == gentoo && ${url} == rsync://* ]]; then |
59 |
> + if ! gemato verify -K "${openpgp_key}" -s "${path}"; then |
60 |
> + eerror "For troubleshooting the verification failures, |
61 |
> please see:" |
62 |
> + eerror " https://wiki.gentoo.org/wiki/ |
63 |
> Project:Portage/Repository_Verification" |
64 |
> + return 1 |
65 |
> + fi |
66 |
> +fi |
67 |
> -- |
68 |
> 2.16.0.rc2 |
69 |
> |
70 |
> |
71 |
> |