What I'm trying to accomplish is to build Android 8 OS in docker container based on Ubuntu 16.04. To get sources I need to use repo tool. The latest repo was installed in Dockerfile. When I do:
repo init -u git://git.osdn.net/gitroot/android-x86/manifest -b oreo-x86 -m android-x86-8.1-r6.xml
I get some Python syntax error, because this command installs the latest repo tool in ./repo which doesn't support default python in Ubuntu 16.
Then I try to add additional arguments to init
to install 1.x version of repo instead of the latest, which will be compatible with python 2.7 or 3.5, with --repo-url
option according to this manual doc.
repo init --repo-url=https://gerrit.googlesource.com/git-repo/+/refs/heads/repo-1 -u git://...
And it says fatal: remote error: Git repository not found
.
Then I try additional option --repo-rev
:
repo init --repo-url=https://gerrit.googlesource.com/git-repo --repo-rev=repo-1 -u git://...
I've got main.py: error: no such option: --repo-rev
. I tried just:
repo init --repo-rv=repo-1 -u git://...
And got the same error.
So my question is: is it possible to install particular version of repo tool with
init
command? And how to do it? How to define correct repo-url
?
I've encountered this problem several times already and I always solved it by installing latest python version. But now I want to try different approach. And don't tell me to download wanted version with curl. I've seen how to do this, but I want to accomplish the same result with init
command if it's possible.
Finally I've found answer myself.
I've found out that repo installed with apt is only launcher. And when repo init
command is issued it installs full Repo tool. More about Repo tool you can read here: https://source.android.com/setup/develop#repo.
It turned out that Repo launcher's version from docs which I referred to was older than currently latest version. And the option to download particular revision was changed. I looked through source code of latest repo version and found correct option.
So to download 1.x version of Repo with init
command use this option:
repo init --repo-branch=repo-1 -u git://...
And this version will be compatible with old Python versions from 2.7 to 3.5.