Commit 8db6c88c authored by ferringb@google.com's avatar ferringb@google.com

Pull in repo v1.18 script for matching repo v1.11.1 update.

BUG=chromium-os:37471
TEST=manual invocations, tracking upstream code, running these
     versions on builders for validation in addition.

Review URL: https://chromiumcodereview.appspot.com/11660027

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@174609 0039d316-1c4b-4281-b951-d872f2087c98
parent a79f5cf7
...@@ -28,10 +28,10 @@ if __name__ == '__main__': ...@@ -28,10 +28,10 @@ if __name__ == '__main__':
del magic del magic
# increment this whenever we make important changes to this script # 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 # increment this if the MAINTAINER_KEYS block is modified
KEYRING_VERSION = (1,0) KEYRING_VERSION = (1,1)
MAINTAINER_KEYS = """ MAINTAINER_KEYS = """
Repo Maintainer <repo@android.kernel.org> Repo Maintainer <repo@android.kernel.org>
...@@ -74,13 +74,45 @@ HTHs37+/QLMomGEGKZMWi0dShU2J5mNRQu3Hhxl3hHDVbt5CeJBb26aQcQrFz69W ...@@ -74,13 +74,45 @@ HTHs37+/QLMomGEGKZMWi0dShU2J5mNRQu3Hhxl3hHDVbt5CeJBb26aQcQrFz69W
zE3GNvmJosh6leayjtI9P2A6iEkEGBECAAkFAkj3uiACGwwACgkQFlMNXpIPXGWp zE3GNvmJosh6leayjtI9P2A6iEkEGBECAAkFAkj3uiACGwwACgkQFlMNXpIPXGWp
TACbBS+Up3RpfYVfd63c1cDdlru13pQAn3NQy/SN858MkxN+zym86UBgOad2 TACbBS+Up3RpfYVfd63c1cDdlru13pQAn3NQy/SN858MkxN+zym86UBgOad2
=CMiZ =CMiZ
-----END PGP PUBLIC KEY BLOCK-----
Conley Owens <cco3@android.com>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux)
mQENBFBiLPwBCACvISTASOgFXwADw2GYRH2I2z9RvYkYoZ6ThTTNlMXbbYYKO2Wo
a9LQD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T/9M9mO9ei/Bc/1D7Dz6qNV+0vg
uSVJxM2Bl6GalHPZLhHntFEdIA6EdoUAEQEAAYkBHwQYAQIACQUCUGIs/AIbDAAK
CRAZJpRVM4hxpNfkB/0W/hP5WK/NETXBlWXXW7JPaWO2c5kGwD0lnj5RRmridyo1
vbm5PdM91jOsDQYqRu6YOoYBnDnEhB2wL2bPh34HWwwrA+LwB8hlcAV2z1bdwyfl
3R823fReKN3QcvLHzmvZPrF4Rk97M9UIyKS0RtnfTWykRgDWHIsrtQPoNwsXrWoT
9LrM2v+1+9mp3vuXnE473/NHxmiWEQH9Ez+O/mOxQ7rSOlqGRiKq/IBZCfioJOtV
fTQeIu/yASZnsLBqr6SJEGwYBoWcyjG++k4fyw8ocOAo4uGDYbxgN7yYfNQ0OH7o
V6pfUgqKLWa/aK7/N1ZHnPdFLD8Xt0Dmy4BPwrKC
=O7am
-----END PGP PUBLIC KEY BLOCK----- -----END PGP PUBLIC KEY BLOCK-----
""" """
GIT = 'git' # our git command GIT = 'git' # our git command
MIN_GIT_VERSION = (1, 5, 4) # minimum supported git version MIN_GIT_VERSION = (1, 5, 4) # minimum supported git version
repodir = '.repo' # name of repo's private directory 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 S_manifests = 'manifests' # special manifest repository
REPO_MAIN = S_repo + '/main.py' # main script REPO_MAIN = S_repo + '/main.py' # main script
...@@ -88,7 +120,6 @@ REPO_MAIN = S_repo + '/main.py' # main script ...@@ -88,7 +120,6 @@ REPO_MAIN = S_repo + '/main.py' # main script
import optparse import optparse
import os import os
import re import re
import readline
import subprocess import subprocess
import sys import sys
import urllib2 import urllib2
...@@ -131,7 +162,7 @@ group.add_option('-g', '--groups', ...@@ -131,7 +162,7 @@ group.add_option('-g', '--groups',
metavar='GROUP') metavar='GROUP')
group.add_option('-p', '--platform', group.add_option('-p', '--platform',
dest='platform', default="auto", 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|...]', 'platform group [auto|all|none|linux|darwin|...]',
metavar='PLATFORM') metavar='PLATFORM')
...@@ -186,7 +217,7 @@ def _Init(args): ...@@ -186,7 +217,7 @@ def _Init(args):
if not os.path.isdir(repodir): if not os.path.isdir(repodir):
try: try:
os.mkdir(repodir) os.mkdir(repodir)
except OSError, e: except OSError as e:
print >>sys.stderr, \ print >>sys.stderr, \
'fatal: cannot make %s directory: %s' % ( 'fatal: cannot make %s directory: %s' % (
repodir, e.strerror) repodir, e.strerror)
...@@ -197,8 +228,8 @@ def _Init(args): ...@@ -197,8 +228,8 @@ def _Init(args):
_CheckGitVersion() _CheckGitVersion()
try: try:
if _NeedSetupGnuPG(): if NeedSetupGnuPG():
can_verify = _SetupGnuPG(opt.quiet) can_verify = SetupGnuPG(opt.quiet)
else: else:
can_verify = True can_verify = True
...@@ -222,7 +253,7 @@ def _CheckGitVersion(): ...@@ -222,7 +253,7 @@ def _CheckGitVersion():
cmd = [GIT, '--version'] cmd = [GIT, '--version']
try: try:
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
except OSError, e: except OSError as e:
print >>sys.stderr print >>sys.stderr
print >>sys.stderr, "fatal: '%s' is not available" % GIT print >>sys.stderr, "fatal: '%s' is not available" % GIT
print >>sys.stderr, 'fatal: %s' % e print >>sys.stderr, 'fatal: %s' % e
...@@ -247,7 +278,7 @@ def _CheckGitVersion(): ...@@ -247,7 +278,7 @@ def _CheckGitVersion():
raise CloneFailure() raise CloneFailure()
def _NeedSetupGnuPG(): def NeedSetupGnuPG():
if not os.path.isdir(home_dot_repo): if not os.path.isdir(home_dot_repo):
return True return True
...@@ -265,11 +296,11 @@ def _NeedSetupGnuPG(): ...@@ -265,11 +296,11 @@ def _NeedSetupGnuPG():
return False return False
def _SetupGnuPG(quiet): def SetupGnuPG(quiet):
if not os.path.isdir(home_dot_repo): if not os.path.isdir(home_dot_repo):
try: try:
os.mkdir(home_dot_repo) os.mkdir(home_dot_repo)
except OSError, e: except OSError as e:
print >>sys.stderr, \ print >>sys.stderr, \
'fatal: cannot make %s directory: %s' % ( 'fatal: cannot make %s directory: %s' % (
home_dot_repo, e.strerror) home_dot_repo, e.strerror)
...@@ -278,7 +309,7 @@ def _SetupGnuPG(quiet): ...@@ -278,7 +309,7 @@ def _SetupGnuPG(quiet):
if not os.path.isdir(gpg_dir): if not os.path.isdir(gpg_dir):
try: try:
os.mkdir(gpg_dir, 0700) os.mkdir(gpg_dir, 0700)
except OSError, e: except OSError as e:
print >>sys.stderr, \ print >>sys.stderr, \
'fatal: cannot make %s directory: %s' % ( 'fatal: cannot make %s directory: %s' % (
gpg_dir, e.strerror) gpg_dir, e.strerror)
...@@ -292,7 +323,7 @@ def _SetupGnuPG(quiet): ...@@ -292,7 +323,7 @@ def _SetupGnuPG(quiet):
proc = subprocess.Popen(cmd, proc = subprocess.Popen(cmd,
env = env, env = env,
stdin = subprocess.PIPE) stdin = subprocess.PIPE)
except OSError, e: except OSError as e:
if not quiet: if not quiet:
print >>sys.stderr, 'warning: gpg (GnuPG) is not available.' print >>sys.stderr, 'warning: gpg (GnuPG) is not available.'
print >>sys.stderr, 'warning: Installing it is strongly encouraged.' print >>sys.stderr, 'warning: Installing it is strongly encouraged.'
...@@ -393,13 +424,13 @@ def _DownloadBundle(url, local, quiet): ...@@ -393,13 +424,13 @@ def _DownloadBundle(url, local, quiet):
try: try:
try: try:
r = urllib2.urlopen(url) r = urllib2.urlopen(url)
except urllib2.HTTPError, e: except urllib2.HTTPError as e:
if e.code == 404: if e.code == 404:
return False return False
print >>sys.stderr, 'fatal: Cannot get %s' % url print >>sys.stderr, 'fatal: Cannot get %s' % url
print >>sys.stderr, 'fatal: HTTP error %s' % e.code print >>sys.stderr, 'fatal: HTTP error %s' % e.code
raise CloneFailure() raise CloneFailure()
except urllib2.URLError, e: except urllib2.URLError as e:
print >>sys.stderr, 'fatal: Cannot get %s' % url print >>sys.stderr, 'fatal: Cannot get %s' % url
print >>sys.stderr, 'fatal: error %s' % e.reason print >>sys.stderr, 'fatal: error %s' % e.reason
raise CloneFailure() raise CloneFailure()
...@@ -428,7 +459,7 @@ def _Clone(url, local, quiet): ...@@ -428,7 +459,7 @@ def _Clone(url, local, quiet):
""" """
try: try:
os.mkdir(local) os.mkdir(local)
except OSError, e: except OSError as e:
print >>sys.stderr, \ print >>sys.stderr, \
'fatal: cannot make %s directory: %s' \ 'fatal: cannot make %s directory: %s' \
% (local, e.strerror) % (local, e.strerror)
...@@ -437,7 +468,7 @@ def _Clone(url, local, quiet): ...@@ -437,7 +468,7 @@ def _Clone(url, local, quiet):
cmd = [GIT, 'init', '--quiet'] cmd = [GIT, 'init', '--quiet']
try: try:
proc = subprocess.Popen(cmd, cwd = local) proc = subprocess.Popen(cmd, cwd = local)
except OSError, e: except OSError as e:
print >>sys.stderr print >>sys.stderr
print >>sys.stderr, "fatal: '%s' is not available" % GIT print >>sys.stderr, "fatal: '%s' is not available" % GIT
print >>sys.stderr, 'fatal: %s' % e print >>sys.stderr, 'fatal: %s' % e
...@@ -539,19 +570,19 @@ def _Checkout(cwd, branch, rev, quiet): ...@@ -539,19 +570,19 @@ def _Checkout(cwd, branch, rev, quiet):
def _FindRepo(): def _FindRepo():
"""Look for a repo installation, starting at the current directory. """Look for a repo installation, starting at the current directory.
""" """
dir = os.getcwd() curdir = os.getcwd()
repo = None repo = None
olddir = None olddir = None
while dir != '/' \ while curdir != '/' \
and dir != olddir \ and curdir != olddir \
and not repo: and not repo:
repo = os.path.join(dir, repodir, REPO_MAIN) repo = os.path.join(curdir, repodir, REPO_MAIN)
if not os.path.isfile(repo): if not os.path.isfile(repo):
repo = None repo = None
olddir = dir olddir = curdir
dir = os.path.dirname(dir) curdir = os.path.dirname(curdir)
return (repo, os.path.join(dir, repodir)) return (repo, os.path.join(curdir, repodir))
class _Options: class _Options:
...@@ -657,13 +688,13 @@ def _SetDefaultsTo(gitdir): ...@@ -657,13 +688,13 @@ def _SetDefaultsTo(gitdir):
def main(orig_args): def main(orig_args):
main, dir = _FindRepo() repo_main, rel_repo_dir = _FindRepo()
cmd, opt, args = _ParseArguments(orig_args) cmd, opt, args = _ParseArguments(orig_args)
wrapper_path = os.path.abspath(__file__) wrapper_path = os.path.abspath(__file__)
my_main, my_git = _RunSelf(wrapper_path) my_main, my_git = _RunSelf(wrapper_path)
if not main: if not repo_main:
if opt.help: if opt.help:
_Usage() _Usage()
if cmd == 'help': if cmd == 'help':
...@@ -683,25 +714,25 @@ def main(orig_args): ...@@ -683,25 +714,25 @@ def main(orig_args):
os.rmdir(os.path.join(root, name)) os.rmdir(os.path.join(root, name))
os.rmdir(repodir) os.rmdir(repodir)
sys.exit(1) sys.exit(1)
main, dir = _FindRepo() repo_main, rel_repo_dir = _FindRepo()
else: else:
_NoCommands(cmd) _NoCommands(cmd)
if my_main: if my_main:
main = my_main repo_main = my_main
ver_str = '.'.join(map(lambda x: str(x), VERSION)) ver_str = '.'.join(map(lambda x: str(x), VERSION))
me = [main, me = [repo_main,
'--repo-dir=%s' % dir, '--repo-dir=%s' % rel_repo_dir,
'--wrapper-version=%s' % ver_str, '--wrapper-version=%s' % ver_str,
'--wrapper-path=%s' % wrapper_path, '--wrapper-path=%s' % wrapper_path,
'--'] '--']
me.extend(orig_args) me.extend(orig_args)
me.extend(extra_args) me.extend(extra_args)
try: try:
os.execv(main, me) os.execv(repo_main, me)
except OSError, e: except OSError as e:
print >>sys.stderr, "fatal: unable to start %s" % main print >>sys.stderr, "fatal: unable to start %s" % repo_main
print >>sys.stderr, "fatal: %s" % e print >>sys.stderr, "fatal: %s" % e
sys.exit(148) sys.exit(148)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment