diff options
Diffstat (limited to 'repo')
-rwxr-xr-x | repo | 33 |
1 files changed, 26 insertions, 7 deletions
@@ -23,10 +23,13 @@ REPO_REV = 'stable' | |||
23 | # limitations under the License. | 23 | # limitations under the License. |
24 | 24 | ||
25 | # increment this whenever we make important changes to this script | 25 | # increment this whenever we make important changes to this script |
26 | VERSION = (1, 22) | 26 | VERSION = (1, 23) |
27 | 27 | ||
28 | # increment this if the MAINTAINER_KEYS block is modified | 28 | # increment this if the MAINTAINER_KEYS block is modified |
29 | KEYRING_VERSION = (1, 2) | 29 | KEYRING_VERSION = (1, 2) |
30 | |||
31 | # Each individual key entry is created by using: | ||
32 | # gpg --armor --export keyid | ||
30 | MAINTAINER_KEYS = """ | 33 | MAINTAINER_KEYS = """ |
31 | 34 | ||
32 | Repo Maintainer <repo@android.kernel.org> | 35 | Repo Maintainer <repo@android.kernel.org> |
@@ -196,6 +199,9 @@ group.add_option('-p', '--platform', | |||
196 | help='restrict manifest projects to ones with a specified ' | 199 | help='restrict manifest projects to ones with a specified ' |
197 | 'platform group [auto|all|none|linux|darwin|...]', | 200 | 'platform group [auto|all|none|linux|darwin|...]', |
198 | metavar='PLATFORM') | 201 | metavar='PLATFORM') |
202 | group.add_option('--no-clone-bundle', | ||
203 | dest='no_clone_bundle', action='store_true', | ||
204 | help='disable use of /clone.bundle on HTTP/HTTPS') | ||
199 | 205 | ||
200 | 206 | ||
201 | # Tool | 207 | # Tool |
@@ -339,7 +345,11 @@ def _Init(args, gitc_init=False): | |||
339 | can_verify = True | 345 | can_verify = True |
340 | 346 | ||
341 | dst = os.path.abspath(os.path.join(repodir, S_repo)) | 347 | dst = os.path.abspath(os.path.join(repodir, S_repo)) |
342 | _Clone(url, dst, opt.quiet) | 348 | _Clone(url, dst, opt.quiet, not opt.no_clone_bundle) |
349 | |||
350 | if not os.path.isfile('%s/repo' % dst): | ||
351 | _print("warning: '%s' does not look like a git-repo repository, is " | ||
352 | "REPO_URL set correctly?" % url, file=sys.stderr) | ||
343 | 353 | ||
344 | if can_verify and not opt.no_repo_verify: | 354 | if can_verify and not opt.no_repo_verify: |
345 | rev = _Verify(dst, branch, opt.quiet) | 355 | rev = _Verify(dst, branch, opt.quiet) |
@@ -432,7 +442,10 @@ def SetupGnuPG(quiet): | |||
432 | sys.exit(1) | 442 | sys.exit(1) |
433 | 443 | ||
434 | env = os.environ.copy() | 444 | env = os.environ.copy() |
435 | env['GNUPGHOME'] = gpg_dir.encode() | 445 | try: |
446 | env['GNUPGHOME'] = gpg_dir | ||
447 | except UnicodeEncodeError: | ||
448 | env['GNUPGHOME'] = gpg_dir.encode() | ||
436 | 449 | ||
437 | cmd = ['gpg', '--import'] | 450 | cmd = ['gpg', '--import'] |
438 | try: | 451 | try: |
@@ -574,7 +587,7 @@ def _ImportBundle(local): | |||
574 | os.remove(path) | 587 | os.remove(path) |
575 | 588 | ||
576 | 589 | ||
577 | def _Clone(url, local, quiet): | 590 | def _Clone(url, local, quiet, clone_bundle): |
578 | """Clones a git repository to a new subdirectory of repodir | 591 | """Clones a git repository to a new subdirectory of repodir |
579 | """ | 592 | """ |
580 | try: | 593 | try: |
@@ -604,7 +617,7 @@ def _Clone(url, local, quiet): | |||
604 | _SetConfig(local, | 617 | _SetConfig(local, |
605 | 'remote.origin.fetch', | 618 | 'remote.origin.fetch', |
606 | '+refs/heads/*:refs/remotes/origin/*') | 619 | '+refs/heads/*:refs/remotes/origin/*') |
607 | if _DownloadBundle(url, local, quiet): | 620 | if clone_bundle and _DownloadBundle(url, local, quiet): |
608 | _ImportBundle(local) | 621 | _ImportBundle(local) |
609 | _Fetch(url, local, 'origin', quiet) | 622 | _Fetch(url, local, 'origin', quiet) |
610 | 623 | ||
@@ -638,7 +651,10 @@ def _Verify(cwd, branch, quiet): | |||
638 | _print(file=sys.stderr) | 651 | _print(file=sys.stderr) |
639 | 652 | ||
640 | env = os.environ.copy() | 653 | env = os.environ.copy() |
641 | env['GNUPGHOME'] = gpg_dir.encode() | 654 | try: |
655 | env['GNUPGHOME'] = gpg_dir | ||
656 | except UnicodeEncodeError: | ||
657 | env['GNUPGHOME'] = gpg_dir.encode() | ||
642 | 658 | ||
643 | cmd = [GIT, 'tag', '-v', cur] | 659 | cmd = [GIT, 'tag', '-v', cur] |
644 | proc = subprocess.Popen(cmd, | 660 | proc = subprocess.Popen(cmd, |
@@ -841,7 +857,10 @@ def main(orig_args): | |||
841 | try: | 857 | try: |
842 | _Init(args, gitc_init=(cmd == 'gitc-init')) | 858 | _Init(args, gitc_init=(cmd == 'gitc-init')) |
843 | except CloneFailure: | 859 | except CloneFailure: |
844 | shutil.rmtree(os.path.join(repodir, S_repo), ignore_errors=True) | 860 | path = os.path.join(repodir, S_repo) |
861 | _print("fatal: cloning the git-repo repository failed, will remove " | ||
862 | "'%s' " % path, file=sys.stderr) | ||
863 | shutil.rmtree(path, ignore_errors=True) | ||
845 | sys.exit(1) | 864 | sys.exit(1) |
846 | repo_main, rel_repo_dir = _FindRepo() | 865 | repo_main, rel_repo_dir = _FindRepo() |
847 | else: | 866 | else: |