Repo --mirror branches

6,736 views
Skip to first unread message

Ne0

unread,
Nov 21, 2011, 10:43:01 AM11/21/11
to Repo and Gerrit Discussion
I have the mirrored the AOSP using

repo init --mirror -u https://android.git.kernel.org/platform/manifest.git
repo sync

on my server. If a client tries running

repo init -u https://android.git.kernel.org/platform/manifest.git -b
gingerbread-release
repo sync

They get stuck as some of the directories on the branch do not seem to
exist in server's mirror.

I suspect this is due to the mirror syncing with the master branch and
the gingerbread-release branch having projects that do not exist in
the master branch (device/htc for instance).

Can anyone confirm or deny my suspicion? and/or tell me what i am need
to do resolve the issue?

Thanks.

Jean-Baptiste Queru

unread,
Nov 21, 2011, 11:24:48 AM11/21/11
to Repo and Gerrit Discussion
Indeed, you've only mirrored the projects that are in the master
branch of the platform, and gingerbread contains additional projects
that you haven't mirrored.

repo init -u https://android.googlesource.com/mirror/manifest --mirror

JBQ

> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Ne0

unread,
Nov 21, 2011, 11:42:26 AM11/21/11
to repo-d...@googlegroups.com
Firstly, do
and 
Have the same effect?

Secondly

Is this the way i should mirror the gingerbread-release branch?

mkdir /path/to/android-gingerbread-release/mirror
cd  /path/to/android-gingerbread-release/mirror
repo init -u https://android.googlesource.com/mirror/manifest -b gingerbread-release --mirror --reference=path/to/android/mirror

Or is there a way of doing it without creating a second mirrored repository? 


Jean-Baptiste Queru

unread,
Nov 21, 2011, 12:01:43 PM11/21/11
to repo-d...@googlegroups.com
There's only a single master branch in mirror/manifest, which contains
all the projects. From there, you can initialize "live" clients for
all branches (even toolchains and kernel).

You can update your existing mirror in-place, syncing it will only add
the projects you don't already have.

JBQ

Ne0

unread,
Nov 21, 2011, 12:07:59 PM11/21/11
to repo-d...@googlegroups.com
Thank you JQB, i finally see my error.

syncing from the wrong manifest for the mirror! 

Ne0

unread,
Nov 22, 2011, 3:56:15 AM11/22/11
to repo-d...@googlegroups.com

I get the following error from that manifest.

fatal: --mirror not supported on existing client

However it does indeed download a full mirror of the AOSP when i sync.

So thanks again.

Emmanuel Grumbach

unread,
Nov 22, 2011, 5:55:57 AM11/22/11
to repo-d...@googlegroups.com
On Tue, Nov 22, 2011 at 10:56, Ne0 <liamjam...@googlemail.com> wrote:
> I get the following error from that manifest.
>
> repo init -u https://android.googlesource.com/mirror/manifest --mirror
>
> fatal: --mirror not supported on existing client
>

You need to erase your .repo dir. You cannot switch between manifests
so easily for bare repositories.

rm -rf .repo

repo sync

Jean-Baptiste Queru

unread,
Nov 22, 2011, 10:23:50 AM11/22/11
to repo-d...@googlegroups.com
Indeed, you don't need to (and you can't) specify --mirror when
switching the manifest of a mirror. Just a plain repo init is enough
to make the mirror point somewhere else.

JBQ

bmeike

unread,
Dec 8, 2011, 12:38:48 PM12/8/11
to Repo and Gerrit Discussion
I have a really slow line and I need to do lots of repo re-creation.
I've probably spent the better part of a month, now, trying to figure
out how to create and use a local mirror for our system.

It looks to me as if the --mirror trick only works with manifests that
use the ".." fetch attribute. Have I got that right?

If so, can anyone suggest a convenient way of building and maintaining
a mirror for a multi-remote system?

I've definitely tried to RTFM... if only I could FTFM (F=find).
Pointers most welcome.

-blake

Magnus Bäck

unread,
Dec 8, 2011, 3:42:08 PM12/8/11
to Repo and Gerrit Discussion
On Thursday, December 08, 2011 at 18:38 CET,
bmeike <blake...@gmail.com> wrote:

> I have a really slow line and I need to do lots of repo re-creation.
> I've probably spent the better part of a month, now, trying to figure
> out how to create and use a local mirror for our system.
>
> It looks to me as if the --mirror trick only works with manifests that
> use the ".." fetch attribute. Have I got that right?

Mirror works anyway, but without the new relative git URLs that were
recently introduced the clients using your mirror need to use Git's
insteadOf mechanism to rewrite the real URL to your local URL. For
example, put the following in ~/.gitconfig:

[url "git://yourserver.example.com/"]
insteadOf = https://android.googlesource.com/

> If so, can anyone suggest a convenient way of building and maintaining
> a mirror for a multi-remote system?

If you've been able to clone all the gits you're almost there, just use
the insteadOf trick on the clients if the relative URLs aren't available
in the manifest you're mirroring.

One thing that can complicate matters is if you want to track the
gits found on multiple manifest branches. Although a git clone contains
all branches, the set of gits listed in different manifests isn't
necessarily the same. Google maintains a mirror manifest that lists
the superset of all gits used in several releases of Android, so if
it's Android you're mirroring you might want to look at that.

You can also write a custom script to do the mirroring for you. That's
what we do.

> I've definitely tried to RTFM... if only I could FTFM (F=find).
> Pointers most welcome.

Setting up mirrors has been discussed on this list a number of times
before.

--
Magnus Bäck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Ne0

unread,
Dec 14, 2011, 8:39:48 AM12/14/11
to Repo and Gerrit Discussion
If you want some help on setting up a mirror properly.

git clone https://github.com/crabpot8/mirror-android-repo.git

Some of the instruction are a little out of date i.e. use repo init -u
https://android.googlesource.com/mirror/manifest --mirror

But it should give you enough to get it sorted.

Reply all
Reply to author
Forward
0 new messages