Merge "Show user about not initializing repo in current directory"
diff --git a/main.py b/main.py
index d993ee4..ba40d56 100755
--- a/main.py
+++ b/main.py
@@ -23,6 +23,7 @@
del magic
import getpass
+import imp
import netrc
import optparse
import os
@@ -167,16 +168,15 @@
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:
diff --git a/repo b/repo
index 7942851..70f4157 100755
--- a/repo
+++ b/repo
@@ -28,10 +28,10 @@
del magic
# increment this whenever we make important changes to this script
-VERSION = (1, 17)
+VERSION = (1, 18)
# increment this if the MAINTAINER_KEYS block is modified
-KEYRING_VERSION = (1,0)
+KEYRING_VERSION = (1,1)
MAINTAINER_KEYS = """
Repo Maintainer <repo@android.kernel.org>
@@ -75,12 +75,44 @@
TACbBS+Up3RpfYVfd63c1cDdlru13pQAn3NQy/SN858MkxN+zym86UBgOad2
=CMiZ
-----END PGP PUBLIC KEY BLOCK-----
+
+ Conley Owens <cco3@android.com>
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.11 (GNU/Linux)
+
+mQENBFBiLPwBCACvISTASOgFXwADw2GYRH2I2z9RvYkYoZ6ThTTNlMXbbYYKO2Wo
+a9LQDNW0TbCEekg5UKk0FD13XOdWaqUt4Gtuvq9c43GRSjMO6NXH+0BjcQ8vUtY2
+/W4CYUevwdo4nQ1+1zsOCu1XYe/CReXq0fdugv3hgmRmh3sz1soo37Q44W2frxxg
+U7Rz3Da4FjgAL0RQ8qndD+LwRHXTY7H7wYM8V/3cYFZ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RRmridyo1
+vbm5PdM91jOsDQYqRu6YOoYBnDnEhB2wL2bPh34HWwwrA+LwB8hlcAV2z1bdwyfl
+3R823fReKN3QcvLHzmvZPrF4Rk97M9UIyKS0RtnfTWykRgDWHIsrtQPoNwsXrWoT
+9LrM2v+1+9mp3vuXnE473/NHxmiWEQH9Ez+O/mOxQ7rSOlqGRiKq/IBZCfioJOtV
+fTQeIu/yASZnsLBqr6SJEGwYBoWcyjG++k4fyw8ocOAo4uGDYbxgN7yYfNQ0OH7o
+V6pfUgqKLWa/aK7/N1ZHnPdFLD8Xt0Dmy4BPwrKC
+=O7am
+-----END PGP PUBLIC KEY BLOCK-----
"""
GIT = 'git' # our git command
MIN_GIT_VERSION = (1, 5, 4) # minimum supported git version
repodir = '.repo' # name of repo's private directory
-S_repo = 'repo' # special repo reposiory
+S_repo = 'repo' # special repo repository
S_manifests = 'manifests' # special manifest repository
REPO_MAIN = S_repo + '/main.py' # main script
@@ -130,7 +162,7 @@
metavar='GROUP')
group.add_option('-p', '--platform',
dest='platform', default="auto",
- help='restrict manifest projects to ones with a specified'
+ help='restrict manifest projects to ones with a specified '
'platform group [auto|all|none|linux|darwin|...]',
metavar='PLATFORM')
@@ -196,8 +228,8 @@
_CheckGitVersion()
try:
- if _NeedSetupGnuPG():
- can_verify = _SetupGnuPG(opt.quiet)
+ if NeedSetupGnuPG():
+ can_verify = SetupGnuPG(opt.quiet)
else:
can_verify = True
@@ -246,7 +278,7 @@
raise CloneFailure()
-def _NeedSetupGnuPG():
+def NeedSetupGnuPG():
if not os.path.isdir(home_dot_repo):
return True
@@ -264,7 +296,7 @@
return False
-def _SetupGnuPG(quiet):
+def SetupGnuPG(quiet):
if not os.path.isdir(home_dot_repo):
try:
os.mkdir(home_dot_repo)
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()