为什么80%的码农都做不了架构师?>>>
今天按照网上说的一些方法下载Android的源码时,报错,其信息如下
Traceback (most recent call last):
File "/opt/android/bin/repo", line 595, in
main(sys.argv[1:])
File "/opt/android/bin/repo", line 562, in main
_Init(args)
File "/opt/android/bin/repo", line 181, in _Init
_CheckGitVersion()
File "/opt/android/bin/repo", line 210, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
由信息中可以看出是因主python程序执行时可能配置有问题,于是根据这个疑问进行了一下搜索,后来终于让我找到,原来是因为我有些依赖库没有安装。执行
$ sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
,然后再执行
$ repo init-u git://Android.git.kernel.org/platform/manifest.git
成功完成初始化,然后再
$ python repo sync
成功完成代码下载.
repo:
#!/bin/sh
## repo default configuration
##
REPO_URL='http://android.git.kernel.org/tools/repo.git'
REPO_REV='stable'
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
manifest.xml:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="korg"
fetch="http://android.git.kernel.org/"
review="review.source.android.com" />
<default revision="master"
remote="korg" />
<project path="build" name="platform/build">
<copyfile src="core/root.mk" dest="Makefile" />
</project>
<project path="bionic" name="platform/bionic" />
<project path="bootable/bootloader/legacy" name="platform/bootable/bootloader/legacy" />
<project path="bootable/diskinstaller" name="platform/bootable/diskinstaller" />
<project path="bootable/recovery" name="platform/bootable/recovery" />
<project path="cts" name="platform/cts" />