Update PGP keys during _PostRepoUpgrade in `sync`
Previously, if a key was added, a client wouldn't add the key during
the sync step. This would cause issues if a new key were added and a
subsequent release were signed by that key.
Change-Id: I4fac317573cd9d0e8da62aa42e00faf08bfeb26c
diff --git a/subcmds/sync.py b/subcmds/sync.py
index a4ca344..a7df7c8 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -46,6 +46,7 @@
from git_command import GIT
from git_refs import R_HEADS, HEAD
+from main import WrapperModule
from project import Project
from project import RemoteSpec
from command import Command, MirrorSafeCommand
@@ -537,7 +538,7 @@
mp.PreSync()
if opt.repo_upgraded:
- _PostRepoUpgrade(self.manifest)
+ _PostRepoUpgrade(self.manifest, opt)
if not opt.local_only:
mp.Sync_NetworkHalf(quiet=opt.quiet,
@@ -611,7 +612,10 @@
if self.manifest.notice:
print self.manifest.notice
-def _PostRepoUpgrade(manifest):
+def _PostRepoUpgrade(manifest, opt):
+ wrapper = WrapperModule()
+ if wrapper.NeedSetupGnuPG():
+ wrapper.SetupGnuPG(opt.quiet)
for project in manifest.projects.values():
if project.Exists:
project.PostRepoUpgrade()