This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os | |
import xml.dom.minidom | |
sourcepath = "/home/charles-chang/imx53qsbandroid4.3/src/" | |
root = xml.dom.minidom.parse(os.path.join(sourcepath,'.repo/manifest.xml')) | |
projlist = [] | |
for node in root.childNodes[0].childNodes: | |
if node.nodeName == 'project': | |
pname = node.getAttribute('name') | |
ppath = node.getAttribute('path') | |
subprocess.call(['git','clone','--mirror',os.path.join(sourcepath,ppath),os.path.join('./',pname)]) |
這樣做完後,還要到 platform 目錄下 單獨 clone .repo/manifests.git 出來,這樣還有修改,吃 argument 作 source path:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os | |
import xml.dom.minidom | |
import sys | |
if len(sys.argv) < 2: | |
print 'Please specify the source path' | |
sys.exit() | |
sourcepath = sys.argv[1] | |
root = xml.dom.minidom.parse(os.path.join(sourcepath,'.repo/manifest.xml')) | |
for node in root.childNodes[0].childNodes: | |
if node.nodeName == 'project': | |
pname = node.getAttribute('name') | |
ppath = node.getAttribute('path') | |
subprocess.call(['git','clone','--mirror',os.path.join(sourcepath,ppath),os.path.join('./',pname+'.git')]) | |
print 'cloning the manifest...' | |
subprocess.call(['git','clone','--mirror',os.path.join(sourcepath,'.repo/manifests.git'),'platform/manifests.git']) | |
但是很奇怪的是,這樣做出來的 folder (假設是 uuu),用 repo init clone 下來後,folder structure 竟然也是 mirror 的結構...
$mkdir uuuclone && cd uuuclone
$repo init -u ~/uuu/platform/manifests.git -b cv3000
$repo sync
但是..再由 uuuclone clone 的話就 OK 了...@_@...
$mkdir uuucloneclone && cd uuucloneclone
$repo init -u ~/uuuclone/platform/manifests.git -b cv3000
$repo sync
不知道為什麼會這樣,但是 uuuclone 已經可以用了,所以就把他放到 git server 的 git-daemon folder 裡..
沒有留言:
張貼留言