【需求价值】:
按周提供打包的全量repo 镜像下载,为开发者获取源代码提供便利
【需求描述】:
【方案描述】:
通过提供全量镜像下载,用户下载这个全量代码包,解压到本地,然后执行一个 repo sync动作,就能增量更新到最新的代码。
为所有有志于阅读,参与鸿蒙系统的用户提供便利。
同时,考虑到源代码仓库巨大,推荐部署torrent 分布式下载分流。
打包命名按周,一周更新一版。
保留最近2周即可,其他的版本不需要保留,只需要保留种子下载。
【配套文档】:
【验收标准】:
提出这个需求的前提,是我在尝试了几天,通过repo工具下载完整的鸿蒙代码,一直遇到错误,推测是gitee的资源不够用,拒绝用户正常下载。
所以非常有必要提供第二种获取源代码的方式。
startup_appspawn:
fatal: the remote end hung up unexpectedly
error: Cannot fetch startup_appspawn from https://gitee.com/openharmony/startup_appspawn
Fetching: 27% (72/263) update_packaging_tools
fatal: the remote end hung up unexpectedly
developtools_ace-ets2bundle:
fatal: the remote end hung up unexpectedly
developtools_ace-ets2bundle: sleeping 4.0 seconds before retrying
fatal: the remote end hung up unexpectedly
developtools_ace-ets2bundle:
fatal: the remote end hung up unexpectedly
error: Cannot fetch developtools_ace-ets2bundle from https://gitee.com/openharmony/developtools_ace-ets2bundle
Fetching: 45% (120/263) distributedschedule_dms_fwk
fatal: the remote end hung up unexpectedly
distributedschedule_samgr:
fatal: the remote end hung up unexpectedly
distributedschedule_samgr: sleeping 4.0 seconds before retrying
fatal: the remote end hung up unexpectedly
由于错误一直都在,我至今仍未能获取全量的鸿蒙源代码。
非常遗憾。
参考 https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
清华大学为 AOSP项目提供的镜像下载,为国内开发者首次获取源代码,提供了便利。
使用每月更新的初始化包
由于首次同步需要下载约 95GB 数据,过程中任何网络故障都可能造成同步失败,我们强烈建议您使用初始化包进行初始化。
下载 https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar,下载完成后记得根据 checksum.txt 的内容校验一下。
由于所有代码都是从隐藏的 .repo 目录中 checkout 出来的,所以我们只保留了 .repo 目录,下载后解压 再 repo sync 一遍即可得到完整的目录。
使用方法如下:
wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar # 下载初始化包
tar xf aosp-latest.tar
cd AOSP # 解压得到的 AOSP 工程目录
# 这时 ls 的话什么也看不到,因为只有一个隐藏的 .repo 目录
repo sync # 正常同步一遍即可得到完整目录
# 或 repo sync -l 仅checkout代码
此后,每次只需运行 repo sync 即可保持同步。 我们强烈建议您保持每天同步,并尽量选择凌晨等低峰时间
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
从2.2-Beta2版本开始, 每个发布版本都会同时发布对应的源码包(含.repo)
最近一次发布版本3.0-LTS对应的源码包下载链接
另外你通过https协议下载如果失败, 建议更换为ssh协议下载, 对应主干下载命令是:
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
这部分内容在源码下载章节有提示, 感兴趣可以看下文档原文
如果不支持,请先下载3.0-LTS源码包,在解压后的目录执行以下命令:
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify # 切换3.0-LTS分支到master分支
repo sync -c # 更新最新代码
repo forall -c 'git lfs pull' # 更新最新lfs内容
@mamingshuai 你们还没明白。Git它协议本来就不具备断点续传。
所以如果中断了。它只会从头开始。
这也是为什么我提这个问题的原因。
很高兴看到你们提供了源码包。感谢。
登录 后才可以发表评论