|
|
|
@ -17,6 +17,7 @@
|
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
|
|
import base64
|
|
|
|
|
import glob
|
|
|
|
|
import json
|
|
|
|
|
import netrc
|
|
|
|
|
import os
|
|
|
|
@ -130,28 +131,30 @@ def get_default_revision():
|
|
|
|
|
return r.replace('refs/heads/', '').replace('refs/tags/', '')
|
|
|
|
|
|
|
|
|
|
def get_from_manifest(devicename):
|
|
|
|
|
try:
|
|
|
|
|
lm = ElementTree.parse(".repo/local_manifests/roomservice.xml")
|
|
|
|
|
lm = lm.getroot()
|
|
|
|
|
except:
|
|
|
|
|
lm = ElementTree.Element("manifest")
|
|
|
|
|
for path in glob.glob(".repo/local_manifests/*.xml"):
|
|
|
|
|
try:
|
|
|
|
|
lm = ElementTree.parse(path)
|
|
|
|
|
lm = lm.getroot()
|
|
|
|
|
except:
|
|
|
|
|
lm = ElementTree.Element("manifest")
|
|
|
|
|
|
|
|
|
|
for localpath in lm.findall("project"):
|
|
|
|
|
if re.search("android_device_.*_%s$" % device, localpath.get("name")):
|
|
|
|
|
return localpath.get("path")
|
|
|
|
|
for localpath in lm.findall("project"):
|
|
|
|
|
if re.search("android_device_.*_%s$" % device, localpath.get("name")):
|
|
|
|
|
return localpath.get("path")
|
|
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
def is_in_manifest(projectpath):
|
|
|
|
|
try:
|
|
|
|
|
lm = ElementTree.parse(".repo/local_manifests/roomservice.xml")
|
|
|
|
|
lm = lm.getroot()
|
|
|
|
|
except:
|
|
|
|
|
lm = ElementTree.Element("manifest")
|
|
|
|
|
|
|
|
|
|
for localpath in lm.findall("project"):
|
|
|
|
|
if localpath.get("path") == projectpath:
|
|
|
|
|
return True
|
|
|
|
|
for path in glob.glob(".repo/local_manifests/*.xml"):
|
|
|
|
|
try:
|
|
|
|
|
lm = ElementTree.parse(path)
|
|
|
|
|
lm = lm.getroot()
|
|
|
|
|
except:
|
|
|
|
|
lm = ElementTree.Element("manifest")
|
|
|
|
|
|
|
|
|
|
for localpath in lm.findall("project"):
|
|
|
|
|
if localpath.get("path") == projectpath:
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
# Search in main manifest, too
|
|
|
|
|
try:
|
|
|
|
|