From c9129d90deb7377324b5178a231657e3d8c74019 Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Mon, 1 Oct 2012 16:12:28 -0700 Subject: 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 --- main.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index d993ee4e..ba40d56b 100755 --- a/main.py +++ b/main.py @@ -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: -- cgit v1.2.3-54-g00ecf