改变的Andr​​oid库版本的最佳方式有效利用一次正回购/混帐下载混帐、有效、版本、方式

2023-09-04 13:24:24 作者:最初的梦!

我有一个情况我需要建立一整套的Andr​​oid源$ C ​​$不同的发行版本的C固定副本。

I've got a situation where I need to build a set of static copies of Android source code of different release versions.

简单地做一个回购初始化-b $版本;回购同步将永远(的init 需要互动,并同步将是浪费我的跨版本带宽)。

Simply doing an repo init -b $version; repo sync will take forever (init requires interaction, and the syncs will be wasteful of my bandwidth across versions).

我目前的设置是下载一个基本的版本(比如1.6_r1),将其复制到一个新的文件夹(Android的1.6_r2),然后重新运行的init 和同步( 回购初始化-b的Andr​​oid 1.6_r2;回购同步)。有时,同步失败虽然有类似错误:

My current setup is to download one base version (say 1.6_r1), copy it to a new folder (android-1.6_r2) and then rerun init and sync (repo init -b android-1.6_r2; repo sync). The sync fails sometimes though, with errors like:

NDK /编译/平台/ Android的3 /弓臂的/ usr /包括      中止      同步工作树:100%(一百五十三分之一百五十三),完成。

ndk/build/platforms/android-3/arch-arm/usr/incl Aborting Syncing work tree: 100% (153/153), done.

错误:开发/:平台/开发结帐caf83cb2b0ffde1a4cfb7cb258cbe012e283d9e1      回购同步返回FAIL在Android上,2.1_r2.1s

error: development/: platform/development checkout caf83cb2b0ffde1a4cfb7cb258cbe012e283d9e1 Repo sync returned FAIL on android-2.1_r2.1s

我发现了类似的错误,有些职位,说明这可能是由于回购是用文件系统中的更改文件同步造成的,但我想知道如果我的错误是不断变化的根据回购的鼻子版本引起的。

I've found some posts with similar errors that indicate this might be caused by repo being out of sync with "changed" files in the filesystem, but I'm wondering if my errors are caused by changing versions under repo's nose.

这是正确的方式去了解不断变化的存储库版本?更一般地,在那里把一个 Android的1.6_r1 库到 Android的1.6_r2时间/带宽高效的方式

Is this the right way to go about changing repository versions? More generally, is there a time/bandwidth efficient way to turn an android-1.6_r1 repository into an android-1.6_r2?

推荐答案

(更新:我最初的回答意味着我们可以逐步的init从previous一个新的回购协议,例如1.6 _r1到1.6_r2,但正确的设置应该已经有一个当地的主镜回购在这里我们可以点基准开始一个新的初始化的时候,我已经修改下面的文本,以避免不正确的含义。)

(UPDATE: my initial answer imply that we can incrementally init a new repo from a previous one, for example 1.6_r1 to 1.6_r2, but the correct setup should have been having one local "main mirror" repo where we can point the reference to when starting a new init. I have modified the text below to avoid the incorrect implication.)

,尝试添加 - 基准= /路径/到/主/回购回购的init 命令在新目录中。

Instead of copying, try adding --reference=/path/to/main/repo to your repo init command on the new directory.

例如,如果你已经在回购 /回购/ AOSP-主先前下载(并同步到googlesource.com)的目录,你可以这样做:

For example, if you already have a repo in /repos/aosp-main directory downloaded earlier (and synced to googlesource.com), you can do:

$ mkdir /repos/aosp-1.6_r1
$ cd /repos/aosp-1.6_r1
$ repo init -b android-1.6_r1 -u https://android.googlesource.com/platform/manifest --reference=/repos/aosp-main
$ repo sync

然后,如果你想有一个不同的版本:

And then, if you want a different version:

$ mkdir /repos/aosp-1.6_r2
$ cd /repos/aosp-1.6_r2
$ repo init -b android-1.6_r2 -u https://android.googlesource.com/platform/manifest --reference=/repos/aosp-main
$ repo sync

这样,我们只需要同步到googlesource.com地址时,有新的东西我们还尚未下载,它应该只使用已同步主回购本地初始化额外的回购协议。

This way, we only need to sync to the googlesource.com address when there is new stuff we haven't downloaded yet and it should just use the already synced main repo to initialize additional repos locally.

 
精彩推荐
图片推荐