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
This commit is contained in:
Conley Owens
2012-10-01 16:12:28 -07:00
parent 57365c98cc
commit c9129d90de
3 changed files with 22 additions and 18 deletions

18
main.py
View File

@@ -23,6 +23,7 @@ if __name__ == '__main__':
del magic
import getpass
import imp
import netrc
import optparse
import os
@@ -167,16 +168,15 @@ def _MyRepoPath():
def _MyWrapperPath():
return os.path.join(os.path.dirname(__file__), 'repo')
_wrapper_module = None
def WrapperModule():
global _wrapper_module
if not _wrapper_module:
_wrapper_module = imp.load_source('wrapper', _MyWrapperPath())
return _wrapper_module
def _CurrentWrapperVersion():
VERSION = None
pat = re.compile(r'^VERSION *=')
fd = open(_MyWrapperPath())
for line in fd:
if pat.match(line):
fd.close()
exec line
return VERSION
raise NameError, 'No VERSION in repo script'
return WrapperModule().VERSION
def _CheckWrapperVersion(ver, repo_path):
if not repo_path: