repo tool syntax error

536 views
Skip to first unread message

Jesús J. Guerrero Botella

unread,
Nov 10, 2013, 11:58:49 AM11/10/13
to android-...@googlegroups.com
I am new in the group, I hope you can give me some hint on what's happening.

I am a Gentoo user, and I know several programming languages, but hace no clue about python, which is what the repo tool is written in. 

I am trying to fetch the sources as per this guide:
http://source.android.com/source/downloading.html

and having no luck. I downloaded the repo tool, and on the first run it told me that it didn't like my default python 3.2 which Gentoo's portage has set up in my system. Fine, I ran it using explicitly the 2.7 version that I also had installed, but it doesn't work anyway. It seems to fetch some kind of list of versions, then abort with a syntax error, which I paste below. I also tried 2.6, just in case, no luck either.

Is this a bug in the tool or am I doing something silly? Is there a guide to fetch this from git somewhere *without* using "repo"?

Thanks beforehand :)

================0
$ python2.6 ../bin/repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1                                
Traceback (most recent call last):
  File "/home/i92guboj/android_sources/.repo/repo/main.py", line 39, in <module>
    from subcmds.version import Version
  File "/home/i92guboj/android_sources/.repo/repo/subcmds/__init__.py", line 36, in <module>
    ['%s' % name])
  File "/home/i92guboj/android_sources/.repo/repo/subcmds/selfupdate.py", line 21, in <module>
    from subcmds.sync import _PostRepoUpgrade
  File "/home/i92guboj/android_sources/.repo/repo/subcmds/sync.py", line 61, in <module>
    from main import WrapperModule
  File "/home/i92guboj/android_sources/.repo/repo/main.py", line 47, in <module>
    from manifest_xml import XmlManifest
  File "/home/i92guboj/android_sources/.repo/repo/manifest_xml.py", line 34, in <module>
    from project import RemoteSpec, Project, MetaProject
  File "/home/i92guboj/android_sources/.repo/repo/project.py", line 1680
    cmd.append(str((u'+refs/heads/*:') + remote.ToLocal('refs/heads/*')))
                                    ^
SyntaxError: invalid syntax

Magnus Bäck

unread,
Nov 11, 2013, 10:15:55 AM11/11/13
to android-...@googlegroups.com
On Sunday, November 10, 2013 at 11:58 EST,
"Jesús J. Guerrero Botella" <jesus.guerr...@gmail.com> wrote:

> I am new in the group, I hope you can give me some hint on what's
> happening.
>
> I am a Gentoo user, and I know several programming languages, but hace
> no clue about python, which is what the repo tool is written in.
>
> I am trying to fetch the sources as per this guide:
> http://source.android.com/source/downloading.html
>
> and having no luck. I downloaded the repo tool, and on the first run
> it told me that it didn't like my default python 3.2 which Gentoo's
> portage has set up in my system. Fine, I ran it using explicitly the
> 2.7 version that I also had installed, but it doesn't work anyway. It
> seems to fetch some kind of list of versions, then abort with a syntax
> error, which I paste below. I also tried 2.6, just in case, no luck
> either.
>
> Is this a bug in the tool or am I doing something silly? Is there a guide
> to fetch this from git somewhere *without* using "repo"?
>
> Thanks beforehand :)
>
> ================0
> $ python2.6 ../bin/repo init -u
> https://android.googlesource.com/platform/manifest -b
> android-4.0.1

While this makes sure you run the wrapper script itself with Python 2.6,
it's just a thin wrapper of the real Repo tool (.repo/repo/main.py)
which has

#!/usr/bin/env python

at the top and therefore gets Python 3.2. The SyntaxError exception you
get is from that script.

[...]

--
Magnus Bäck
ba...@google.com
Reply all
Reply to author
Forward
0 new messages