Created
November 5, 2013 02:45
-
-
Save zhangchunlin/7313016 to your computer and use it in GitHub Desktop.
repo manifest
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
#! /usr/bin/env python | |
#coding=utf-8 | |
MANIFEST_HEADER = r'''<?xml version="1.0" encoding="UTF-8"?> | |
<manifest> | |
<remote fetch="https://github.com/" name="github" review="review.cyanogenmod.org"/> | |
<default remote="github" revision="refs/heads/cm-10.2"/> | |
''' | |
MANIFEST_FOOTER = r''' | |
</manifest> | |
''' | |
def main(): | |
import xml.etree.ElementTree as ET | |
f = open("default.xml","w") | |
f.write(MANIFEST_HEADER) | |
tree = ET.parse('../android/default.xml') | |
root = tree.getroot() | |
for c in root: | |
if c.tag=='project' and c.attrib.get('remote','github')=='github': | |
f.write(' <project name="%s" />\n'%(c.attrib['name'])) | |
f.write(MANIFEST_FOOTER) | |
f.close() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment