summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-02-03 12:26:05 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-02-03 12:26:05 +0100
commit7fcb81ad1892e123e3b2c67abea966f370112c83 (patch)
treeaf3a7eae2c62a82d2a6c7c2f329be343fc335952 /tools
parentd1b082df91cb842e314cfb66dda53dc698d4c78c (diff)
parent705e90f0903eed0fa2ea92e80b8a5f3f09630cb0 (diff)
downloadbuild-7fcb81ad1892e123e3b2c67abea966f370112c83.zip
build-7fcb81ad1892e123e3b2c67abea966f370112c83.tar.gz
build-7fcb81ad1892e123e3b2c67abea966f370112c83.tar.bz2
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_build into replicant-6.0
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'tools')
-rw-r--r--tools/releasetools/common.py18
-rwxr-xr-xtools/releasetools/ota_from_target_files.py4
-rwxr-xr-xtools/roomservice.py23
-rw-r--r--tools/signapk/SignApk.java21
4 files changed, 42 insertions, 24 deletions
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index de2660a..4f8db79 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -268,9 +268,10 @@ def LoadRecoveryFSTab(read_helper, fstab_version, type):
else:
print("%s: unknown option \"%s\"" % (mount_point, i))
- d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[1],
- device=pieces[2], length=length,
- device2=device2)
+ if not d.get(mount_point):
+ d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[1],
+ device=pieces[2], length=length,
+ device2=device2)
elif fstab_version == 2:
d = {}
@@ -306,9 +307,10 @@ def LoadRecoveryFSTab(read_helper, fstab_version, type):
context = i
mount_point = pieces[1]
- d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[2],
- device=pieces[0], length=length,
- device2=None, context=context)
+ if not d.get(mount_point):
+ d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[2],
+ device=pieces[0], length=length,
+ device2=None, context=context)
else:
raise ValueError("Unknown fstab_version: \"%d\"" % (fstab_version,))
@@ -395,10 +397,10 @@ def BuildBootableImage(sourcedir, fs_config_file, info_dict=None):
cmd.append("--ramdisk_offset")
cmd.append(open(fn).read().rstrip("\n"))
- fn = os.path.join(sourcedir, "dt_args")
+ fn = os.path.join(sourcedir, "dt")
if os.access(fn, os.F_OK):
cmd.append("--dt")
- cmd.append(open(fn).read().rstrip("\n"))
+ cmd.append(fn)
fn = os.path.join(sourcedir, "pagesize")
if os.access(fn, os.F_OK):
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index bd34dc9..ff0ccb9 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -824,7 +824,9 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip):
source_zip=source_zip,
source_version=source_version,
target_zip=target_zip,
+ input_zip=target_zip,
target_version=target_version,
+ input_version=target_version,
output_zip=output_zip,
script=script,
metadata=metadata,
@@ -1229,7 +1231,9 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
source_zip=source_zip,
source_version=source_version,
target_zip=target_zip,
+ input_zip=target_zip,
target_version=target_version,
+ input_version=target_version,
output_zip=output_zip,
script=script,
metadata=metadata,
diff --git a/tools/roomservice.py b/tools/roomservice.py
index ee8e5d8..a1b69cd 100755
--- a/tools/roomservice.py
+++ b/tools/roomservice.py
@@ -87,9 +87,9 @@ if not depsonly:
local_manifests = r'.repo/local_manifests'
if not os.path.exists(local_manifests): os.makedirs(local_manifests)
-def exists_in_tree(lm, repository):
+def exists_in_tree(lm, path):
for child in lm.getchildren():
- if child.attrib['name'].endswith(repository):
+ if child.attrib['path'] == path:
return True
return False
@@ -139,7 +139,7 @@ def get_from_manifest(devicename):
return None
-def is_in_manifest(projectname):
+def is_in_manifest(projectpath):
try:
lm = ElementTree.parse(".repo/local_manifests/roomservice.xml")
lm = lm.getroot()
@@ -147,8 +147,8 @@ def is_in_manifest(projectname):
lm = ElementTree.Element("manifest")
for localpath in lm.findall("project"):
- if localpath.get("name") == projectname:
- return 1
+ if localpath.get("path") == projectpath:
+ return True
## Search in main manifest, too
try:
@@ -158,10 +158,10 @@ def is_in_manifest(projectname):
lm = ElementTree.Element("manifest")
for localpath in lm.findall("project"):
- if localpath.get("name") == projectname:
- return 1
+ if localpath.get("path") == projectpath:
+ return True
- return None
+ return False
def add_to_manifest(repositories, fallback_branch = None):
try:
@@ -173,8 +173,9 @@ def add_to_manifest(repositories, fallback_branch = None):
for repository in repositories:
repo_name = repository['repository']
repo_target = repository['target_path']
- if exists_in_tree(lm, repo_name):
- print('CyanogenMod/%s already exists' % (repo_name))
+ print('Checking if %s is fetched from %s' % (repo_target, repo_name))
+ if is_in_manifest(repo_target):
+ print('CyanogenMod/%s already fetched to %s' % (repo_name, repo_target))
continue
print('Adding dependency: CyanogenMod/%s -> %s' % (repo_name, repo_target))
@@ -210,7 +211,7 @@ def fetch_dependencies(repo_path, fallback_branch = None):
fetch_list = []
for dependency in dependencies:
- if not is_in_manifest("CyanogenMod/%s" % dependency['repository']):
+ if not is_in_manifest(dependency['target_path']):
fetch_list.append(dependency)
syncable_repos.append(dependency['target_path'])
diff --git a/tools/signapk/SignApk.java b/tools/signapk/SignApk.java
index 88f486a..3ddab11 100644
--- a/tools/signapk/SignApk.java
+++ b/tools/signapk/SignApk.java
@@ -167,18 +167,29 @@ class SignApk {
}
/**
- * Reads the password from console and returns it as a string.
+ * If a console doesn't exist, reads the password from stdin
+ * If a console exists, reads the password from console and returns it as a string.
*
* @param keyFile The file containing the private key. Used to prompt the user.
*/
private static String readPassword(File keyFile) {
Console console;
char[] pwd;
- if((console = System.console()) != null &&
- (pwd = console.readPassword("[%s]", "Enter password for " + keyFile)) != null){
- return String.valueOf(pwd);
+ if ((console = System.console()) == null) {
+ System.out.print("Enter password for " + keyFile + " (password will not be hidden): ");
+ System.out.flush();
+ BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ try {
+ return stdin.readLine();
+ } catch (IOException ex) {
+ return null;
+ }
} else {
- return null;
+ if ((pwd = console.readPassword("[%s]", "Enter password for " + keyFile)) != null) {
+ return String.valueOf(pwd);
+ } else {
+ return null;
+ }
}
}