查看: 13521|回复: 0

windows git repo下载Android源码 windowserror 5错误

[复制链接]

404

主题

246

回帖

2万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
20407
发表于 2021-7-21 16:21:49 | 显示全部楼层 |阅读模式
用windows搭建的git repo下载android源码,

前面挺顺利,但是到Syncing work tree步骤遇到报错
报错如下
  1. File "E:\LocalProject\Oreo\.repo\repo\project.py", line 1294, in _CopyAndLinkF
  2.     linkfile._Link()
  3.   File "E:\LocalProject\Oreo\.repo\repo\project.py", line 299, in _Link
  4.     self.__linkIt(self.src_rel_to_dest, self.abs_dest)
  5.   File "E:\LocalProject\Oreo\.repo\repo\project.py", line 279, in __linkIt
  6.     os.remove(absDest)
  7. WindowsError: [Error 5] : u'E:\\LocalProject\\Oreo\\build/core
复制代码
定位到project.py文件,是这句 os.remove(absDest) 出错了,
跟下面这个贴子的大神改成这样
def __linkIt(self, relSrc, absDest):
    # link file if it does not exist or is out of date
    # if not os.path.islink(absDest) or (os.readlink(absDest) != relSrc):
    if not portable.os_path_islink(absDest) or (portable.os_path_realpath(absDest) != relSrc):
      try:
        # remove existing file first, since it might be read-only
        if os.path.lexists(absDest):
         #  os.remove(absDest)
          if os.path.isfile(absDest):
                os.remove(absDest)
          else:
                os.removedirs(absDest)
        else:
          dest_dir = os.path.dirname(absDest)
          if not os.path.isdir(dest_dir):
            os.makedirs(dest_dir)
        # os.symlink(relSrc, absDest)
        portable.os_symlink(relSrc, absDest)
      except IOError:
        _error('Cannot link file %s to %s', relSrc, absDest)

问题解决了
参考
https://segmentfault.com/a/1190000015303640


新问题
error: invalid path 'frontend/client/src/autotest/public/Open+Sans:300.woff'
Traceback (most recent call last):
  File "D:\git\tinkerR\.repo\repo/main.py", line 538, in <module>
    _Main(sys.argv[1:])
  File "D:\git\tinkerR\.repo\repo/main.py", line 512, in _Main
    result = repo._Run(argv) or 0
  File "D:\git\tinkerR\.repo\repo/main.py", line 185, in _Run
    result = cmd.Execute(copts, cargs)
  File "D:\git\tinkerR\.repo\repo\subcmds\sync.py", line 823, in Execute
    project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
  File "D:\git\tinkerR\.repo\repo\project.py", line 1336, in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync)
  File "D:\git\tinkerR\.repo\repo\project.py", line 2503, in _InitWorkTree
    raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
解决方法:打开.repo\repo\project.py文件,屏蔽这两行
      #  if GitCommand(self, cmd).Wait() != 0:
      #    raise GitError("cannot initialize work tree")



风火轮微信公众号
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|风火轮WIKI|手机版|小黑屋|深圳风火轮团队 ( 粤ICP备17095099号 )

GMT+8, 2024-4-19 16:16 , Processed in 0.047305 second(s), 19 queries .

快速回复 返回顶部 返回列表
 
【客服1】 商务合作 15289193
【客服2】 业务洽谈 13257599
【客服3】 售前咨询 510313198
【邮箱】
smartfire@smartfire.cn