减少Android源库.repo目录的大小 [英] Reduce the Size of the Android Source Repository .repo Directory

查看:917
本文介绍了减少Android源库.repo目录的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



  repo init -u https: //android.googlesource.com/platform/manifest -b android-4.4_r1.2 
repo sync

最近的标记是 android-5.0.0_r2 。我注意到我的.repo目录的大小现在是30 GB。这是预期的大小?如果没有,那么我推测我已经存储在.repo目录中的其他分支/标签的历史记录。



有没有办法减少.repo目录的大小?我想限制只有源/对象/图像/等。我需要我正在工作的特定分支。硬盘空间对我来说比下载时间更重要。



我在.git存储库上使用了 git gc 但在这种情况下不起作用。 .repo存储库是否有相同的内容?



注意:我确实尝试了 repo prune ,但这并没有减少.repo目录的大小。 / p>

解决方案

-c 标志似乎不再受支持,但这里是你可以做的。



在撰写本文时,
repo init -u https://android.googlesource .com / platform / manifest -b android-5.1.0_r5 创建 33GB的文件。



添加 - depth = 1 将其减少到 21GB

添加 - groups = all,-notdefault,-device,-darwin,-x86,-mips,-exynos5 将您不感兴趣的设备和组件排除在外 19GB



仅用于存储,您可以删除.repo / .re中每个.git存储库的签出文件以节省更多空间,但是我不知道如何编写脚本。如果您这样做, repo sync 会在需要时检出missing文件。



我的完整命令行是

repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.0_r5 --depth = 1 --groups = all,-notdefault,-device,-darwin,-x86,-mips,-exynos5,mako

,所以这棵树只适用于Nexus 4.我有 not 尚未尝试从此树构建,但没有理由不起作用。



您也可以移除您未使用的项目指定本地清单,甚至可以使用压缩文件系统(如带有正确安装选项的btrfs)工作,但我不确定性能的影响。

I have been switching between several branches of the Android source code with the commands like:

repo init -u https://android.googlesource.com/platform/manifest -b android-4.4_r1.2
repo sync

The most recent tag was android-5.0.0_r2. I noticed my .repo directory is now 30 GB in size. Is that the expected size? If not, then I'm speculating I have history from the other branches/tags I've used stored in the .repo directory.

Is there a way to reduce the size of the .repo directory? I would like to limit to only the source/objects/images/etc. I need for the particular branch I'm working on. HDD space is more important to me than download time.

I see git gc is used on .git repositories, but that doesn't work in this case. Is there an equivalent for .repo repositories?

Note: I did try repo prune, but that did not reduce the size of the .repo directory.

解决方案

The -c flag doesn't seem to be supported any more, but here's what you can do.

At the time of writing, repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.0_r5 creates 33GB worth of files.

Adding --depth=1 reduces this to 21GB.

Adding --groups=all,-notdefault,-device,-darwin,-x86,-mips,-exynos5 to exclude devices and components you're not interested in reduces this to 19GB.

For storage only, you could remove the checked-out files for each .git repository inside .repo/ to save even more space, but I'm not sure how to script this. If you did do this, repo sync would check out the "missing" files when needed.

For reference, my complete command line was
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.0_r5 --depth=1 --groups=all,-notdefault,-device,-darwin,-x86,-mips,-exynos5,mako
so this tree would only work for the Nexus 4. I have not yet tried to build from this tree but there's no reason it wouldn't work.

You could also remove projects you're not using by specifying a local manifest, or even work from a compressed filesystem like btrfs with the right mount options, but I'm unsure of the performance impact.

这篇关于减少Android源库.repo目录的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆