wukercheng的个人空间 https://blog.eetop.cn/122094 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

使用代理下载Android源代码

已有 6035 次阅读| 2010-10-2 09:40

公司使用代理上网,proxy不支持git,尝试了很多办法,最后成功。
方法如下:

1 安装Android build环境需要的工具

参考source.android.com "get source"

2 Installing Repo

  1. Make sure you have a~/bindirectory in your home directory, and check to be sure that this bin directory is in your path:
    $ cd ~
    $ mkdir bin
    $ echo $PATH
  2. Download there poscript. and make sure it is executable:
    $ export http_proxy=http://your.proxy:8080
    $ curl http://android.git.kernel.org/repo >~/bin/repo
    $ chmod a+x ~/bin/repo
    $ 修改repo文件
    REPO_URL='git://android.git.kernel.org/tools/repo.git' 改成
    REPO_URL='http://android.git.kernel.org/tools/repo.git'

Initializing a Repo client

  1. Create an empty directory to hold your working files:
    $ mkdir mydroid
    $ cd mydroid
  2. Run "repo init" to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:
    $ repo init -u  http://android.git.kernel.org/platform/manifest.git
    • If you would like to check out a branch other than "master", specify it with -b, like:
      $ repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
  3. When prompted, configure Repo with your real name and email address. If you plan to submit code, use an email address that is associated with a Google account .
注意上面红色字体标注(git修改为http)

repo init成功之后,
打开 .repo\repo\project.py 修改_InitRemote函数
  def _InitRemote(self):
    if self.remote.url:
      remote = self.GetRemote(self.remote.name)
      #remote.url = self.remote.url
      # use http instead
      remote.url = self.remote.url.replace("git://", "http://")
      remote.review = self.remote.review
      remote.projectname = self.name

      if self.worktree:
        remote.ResetFetch(mirror=False)
      else:
        remote.ResetFetch(mirror=True)
      remote.Save()
然后执行
repo sync

(代理下载,下载一些大文件时,链接可能死掉,CTRL+C
再执行repo sync即可)

hope it may be helpful




点赞

全部作者的其他最新日志

发表评论 评论 (5 个评论)

回复 goldenstone 2010-10-7 09:40
Thanks!
回复 goldenstone 2010-10-7 09:41
The information is useful
回复 goldenstone 2010-10-7 09:43
I will try
回复 wukercheng 2011-4-20 17:13
pppd modem -d -detach lock /dev/ttyACM2 230400 kdebug 4 file /etc/ppp/options crtscts noipdefault netmask 255.255.255.0 defaultroute connect /etc/ppp/chat-script0 > /dev/null &
回复 wukercheng 2011-4-20 17:19
echo "1" > /proc/sys/net/ipv4/ip_forward echo "6" > /proc/sys/kernel/printk iptables -F iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 1

    粉丝
  • 0

    好友
  • 0

    获赞
  • 5

    评论
  • 215

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-3 04:39 , Processed in 0.014875 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部