Created
May 23, 2013 09:07
-
-
Save checko/5633767 to your computer and use it in GitHub Desktop.
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']) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment